source: Git/src/main/java/com/wediscussmovies/project/model/Discussion.java@ 7fafead

main
Last change on this file since 7fafead was 7fafead, checked in by Test <matonikolov77@…>, 2 years ago

Resolving models

  • Property mode set to 100644
File size: 1.4 KB
Line 
1package com.wediscussmovies.project.model;
2
3import com.wediscussmovies.project.model.enumerations.DiscussionType;
4import lombok.Data;
5
6import javax.persistence.*;
7import java.sql.Date;
8import java.util.Collection;
9import java.util.List;
10import java.util.Objects;
11
12@Data
13@Entity
14@Table(name = "discussions", schema = "project", catalog = "db_202122z_va_prj_wediscussmovies")
15public class Discussion {
16
17 @GeneratedValue(strategy = GenerationType.IDENTITY)
18 @Id
19 @Column(name = "discussion_id")
20 private Long id;
21
22 @Enumerated
23 private DiscussionType type;
24
25 private String text;
26
27 private String title;
28
29 private Date date;
30
31
32
33
34
35 @ManyToOne
36 @JoinColumn(name = "user_id", referencedColumnName = "user_id", nullable = false)
37 private User user;
38
39 @ManyToOne
40 @JoinColumn(name = "movie_id", referencedColumnName = "movie_id")
41 private Movie movie;
42
43 @ManyToOne
44 @JoinColumn(name = "person_id", referencedColumnName = "person_id")
45 private Person person;
46
47
48
49
50
51
52 public Discussion(DiscussionType type, String text, String title, Date date, User user, Movie movie, Person person, List<Reply> replies) {
53 this.type = type;
54 this.text = text;
55 this.title = title;
56 this.date = date;
57 this.user = user;
58 this.movie = movie;
59 this.person = person;
60 }
61
62 public Discussion() {
63 }
64
65
66}
Note: See TracBrowser for help on using the repository browser.