Ignore:
Timestamp:
01/16/22 15:29:49 (3 years ago)
Author:
Petar Partaloski <ppartaloski@…>
Branches:
main
Children:
7bc8942
Parents:
7a0bf79
Message:

Controller, Repository and Service layer improvements, Entity updating

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/main/java/com/wediscussmovies/project/model/Discussion.java

    r7a0bf79 r2a5d6a3  
    99@Data
    1010@Entity
     11@Table (name="discussions")
    1112public class Discussion {
    1213    @Id
     
    3536    private Date date;
    3637
     38    @Column(name = "type", nullable = false)
     39    private DiscussionType type;
    3740    @OneToMany
    3841    private List<Reply> replies;
     42
     43    public Discussion() {
     44    }
     45
     46    public Discussion(String title, String text, User user, Movie movie, Date valueOf) {
     47        this.title = title;
     48        this.text = text;
     49        this.user = user;
     50        this.date = valueOf;
     51        this.movie = movie;
     52        this.type = DiscussionType.M;
     53    }
     54
     55    public Discussion(String title, String text, User user, Person person, Date valueOf) {
     56        this.title = title;
     57        this.text = text;
     58        this.user = user;
     59        this.date = valueOf;
     60        this.person = person;
     61        this.type = DiscussionType.P;
     62    }
     63
     64
    3965}
    4066
Note: See TracChangeset for help on using the changeset viewer.