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/Person.java

    r7a0bf79 r2a5d6a3  
    55import javax.persistence.*;
    66import java.sql.Date;
     7import java.util.Comparator;
    78import java.util.List;
    89
    910@Data
    10 @Entity(name="persons")
     11@Entity
     12@Table(name="persons")
    1113public class Person {
    1214    @Id
     
    3436    @ManyToMany
    3537    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);
    3652}
    3753
Note: See TracChangeset for help on using the changeset viewer.