/
dmuruz
/
Course_Service
Обзор
Документация
Войти
/
dmuruz
/
Course_Service
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
CI/CD
Аналитика
Безопасность
dev
src/main/java/org/example/model/Course.java
55 строк
1 KB
Danil Muruz
MVP
24 апр 2025, 09:39
24 апр 2025, 09:39
16b1c45
Код
Авторство
О чём код?
package org.example.model; import com.fasterxml.jackson.annotation.JsonManagedReference; import jakarta.persistence.*; import java.util.List; @Entity @Table(name = "courses") public class Course { @Id @GeneratedValue(strategy = GenerationType.IDENTITY) private Long id; private String name; private String description; @Column(name = "order_num") private Integer orderNum; @OneToMany(mappedBy = "course", cascade = CascadeType.ALL, fetch = FetchType.LAZY) @JsonManagedReference private List<Lesson> lessons; public Long getId() { return id; } public void setId(Long id) { this.id = id; } public String getName() { return name; } public void setName(String name) { this.name = name; } public String getDescription() { return description; } public void setDescription(String description) { this.description = description; } public Integer getOrderNum() { return orderNum; } public void setOrderNum(Integer orderNum) { this.orderNum = orderNum; } public List<Lesson> getLessons() { return lessons; } public void setLessons(List<Lesson> lessons) { this.lessons = lessons; } }