|
Last change
on this file was 5ea00d7, checked in by Malek Alavi <malekalavi7@…>, 8 days ago |
|
Initial project upload
|
-
Property mode
set to
100644
|
|
File size:
1023 bytes
|
| Line | |
|---|
| 1 | package mk.ukim.finki.wp.db.entity;
|
|---|
| 2 |
|
|---|
| 3 | import jakarta.persistence.*;
|
|---|
| 4 | import lombok.*;
|
|---|
| 5 | import mk.ukim.finki.wp.db.entity.user.Instructor;
|
|---|
| 6 |
|
|---|
| 7 | import java.math.BigDecimal;
|
|---|
| 8 | import java.util.HashSet;
|
|---|
| 9 | import java.util.Set;
|
|---|
| 10 |
|
|---|
| 11 | @Entity
|
|---|
| 12 | @Table(name = "course")
|
|---|
| 13 | @Getter
|
|---|
| 14 | @Setter
|
|---|
| 15 | @NoArgsConstructor
|
|---|
| 16 | @AllArgsConstructor
|
|---|
| 17 | @Builder
|
|---|
| 18 | public class Course {
|
|---|
| 19 |
|
|---|
| 20 | @Id
|
|---|
| 21 | @GeneratedValue(strategy = GenerationType.IDENTITY)
|
|---|
| 22 | @Column(name = "course_id")
|
|---|
| 23 | private Integer courseId;
|
|---|
| 24 |
|
|---|
| 25 | @Column(nullable = false, length = 150)
|
|---|
| 26 | private String name;
|
|---|
| 27 |
|
|---|
| 28 | @Column(precision = 10, scale = 2)
|
|---|
| 29 | private BigDecimal price;
|
|---|
| 30 |
|
|---|
| 31 | @Column(length = 30)
|
|---|
| 32 | private String status;
|
|---|
| 33 |
|
|---|
| 34 | @ManyToOne(optional = false)
|
|---|
| 35 | @JoinColumn(name = "instructor_id")
|
|---|
| 36 | private Instructor instructor;
|
|---|
| 37 |
|
|---|
| 38 | @ManyToMany
|
|---|
| 39 | @JoinTable(
|
|---|
| 40 | name = "course_category",
|
|---|
| 41 | joinColumns = @JoinColumn(name = "course_id"),
|
|---|
| 42 | inverseJoinColumns = @JoinColumn(name = "category_id")
|
|---|
| 43 | )
|
|---|
| 44 | private Set<Category> categories = new HashSet<>();
|
|---|
| 45 | }
|
|---|
| 46 |
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.