Changeset 2a5d6a3 in Git for src/main/java/com/wediscussmovies/project/model
- Timestamp:
- 01/16/22 15:29:49 (3 years ago)
- Branches:
- main
- Children:
- 7bc8942
- Parents:
- 7a0bf79
- Location:
- src/main/java/com/wediscussmovies/project/model
- Files:
-
- 6 added
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
src/main/java/com/wediscussmovies/project/model/Discussion.java
r7a0bf79 r2a5d6a3 9 9 @Data 10 10 @Entity 11 @Table (name="discussions") 11 12 public class Discussion { 12 13 @Id … … 35 36 private Date date; 36 37 38 @Column(name = "type", nullable = false) 39 private DiscussionType type; 37 40 @OneToMany 38 41 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 39 65 } 40 66 -
src/main/java/com/wediscussmovies/project/model/Genre.java
r7a0bf79 r2a5d6a3 3 3 import lombok.Data; 4 4 5 import javax.persistence.Column; 6 import javax.persistence.Entity; 7 import javax.persistence.GeneratedValue; 8 import javax.persistence.Id; 5 import javax.persistence.*; 9 6 10 7 @Data 11 @Entity(name="genres") 8 @Entity 9 @Table(name="genres") 12 10 public class Genre { 13 11 @Id -
src/main/java/com/wediscussmovies/project/model/Movie.java
r7a0bf79 r2a5d6a3 8 8 import java.util.List; 9 9 @Data 10 @Entity(name="movies") 10 @Entity 11 @Table (name="movies") 11 12 public class Movie { 12 13 @Id … … 61 62 public static Comparator<Movie> comparatorTitle = Comparator.comparing(Movie::getTitle); 62 63 64 public Movie() { 65 } 66 63 67 public Movie(String title, String description, String image_url, Date airing_date, float imdb_rating, Person director, List<Person> actors, List<Genre> genres) { 64 68 Title = title; -
src/main/java/com/wediscussmovies/project/model/Person.java
r7a0bf79 r2a5d6a3 5 5 import javax.persistence.*; 6 6 import java.sql.Date; 7 import java.util.Comparator; 7 8 import java.util.List; 8 9 9 10 @Data 10 @Entity(name="persons") 11 @Entity 12 @Table(name="persons") 11 13 public class Person { 12 14 @Id … … 34 36 @ManyToMany 35 37 private List<Movie> acts_in; 38 39 public Person(String name, String surname, PersonType personType, Date date_of_birth, String image_url, String description) { 40 this.name = name; 41 this.surname = surname; 42 this.personType = personType; 43 this.date_of_birth = date_of_birth; 44 this.image_url = image_url; 45 this.description = description; 46 } 47 48 public Person() { 49 } 50 51 public static Comparator<Person> personComparatorByNameSurname = Comparator.comparing(Person::getName).thenComparing(Person::getSurname); 36 52 } 37 53 -
src/main/java/com/wediscussmovies/project/model/Reply.java
r7a0bf79 r2a5d6a3 5 5 import javax.persistence.*; 6 6 import java.sql.Date; 7 import java.util.Optional; 7 8 8 9 @Data 9 @Entity(name="replies") 10 @Entity 11 @Table(name="replies") 10 12 public class Reply { 11 13 @Id … … 27 29 @Column(name= "text", length = 1000, nullable = false) 28 30 private String text; 31 32 public Reply(Discussion discussion, User user, Date date, String text) { 33 this.discussion = discussion; 34 this.user = user; 35 this.date = date; 36 this.text = text; 37 } 29 38 } 30 39 -
src/main/java/com/wediscussmovies/project/model/User.java
r7a0bf79 r2a5d6a3 7 7 8 8 @Data 9 @Entity(name="users") 9 @Entity 10 @Table(name="users") 10 11 public class User { 11 12 @Id … … 36 37 private List<Genre> likes_genres; 37 38 39 public User(String username, String name, String surname, String email, String password) { 40 this.username = username; 41 this.name = name; 42 this.surname = surname; 43 this.email = email; 44 this.password = password; 45 } 46 47 public User() { 48 } 38 49 } 39 50
Note:
See TracChangeset
for help on using the changeset viewer.