Changes in / [8ae6217:4885da3]
- Location:
- Prototype Application/Paw5/src/main/java/finki/paw5/model
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
Prototype Application/Paw5/src/main/java/finki/paw5/model/Admin.java
r8ae6217 r4885da3 1 1 package finki.paw5.model; 2 2 3 import jakarta.persistence.*; 3 import jakarta.persistence.Column; 4 import jakarta.persistence.Entity; 5 import jakarta.persistence.Id; 6 import jakarta.persistence.Table; 4 7 import lombok.Data; 5 6 import java.time.LocalDate;7 8 8 9 @Data 9 10 @Entity 10 11 @Table(name = "admin_table") 11 @PrimaryKeyJoinColumn(name = "id_user") 12 public class Admin extends User { 12 public class Admin { 13 13 14 public Admin(LocalDate dateCreated, String name, String email, String password, String telephone) { 15 super(dateCreated, name, email, password, telephone); 14 @Id 15 @Column(name = "id_user", nullable = false) 16 private int id; 17 18 public Admin(int id) { 19 this.id = id; 16 20 } 17 21 -
Prototype Application/Paw5/src/main/java/finki/paw5/model/Adopter.java
r8ae6217 r4885da3 5 5 import finki.paw5.model.enumerations.Housing; 6 6 import finki.paw5.model.enumerations.PhysicalActivity; 7 import jakarta.persistence.*; 7 import jakarta.persistence.Column; 8 import jakarta.persistence.Entity; 9 import jakarta.persistence.Id; 10 import jakarta.persistence.Table; 8 11 import lombok.Data; 9 10 import java.time.LocalDate;11 12 12 13 @Data 13 14 @Entity 14 15 @Table(name = "adopter") 15 @PrimaryKeyJoinColumn(name = "id_user") 16 public class Adopter extends User { 16 public class Adopter { 17 18 @Id 19 @Column(name = "id_user", nullable = false) 20 private int id; 17 21 18 22 @Column(name = "free_time") … … 43 47 private int verifiedByEmployeeId; 44 48 45 public Adopter(LocalDate dateCreated, String name, String email, String password, String telephone, 46 FreeTime freeTime, Funds funds, boolean hasOtherPets, boolean hasKids, Housing housing, 47 PhysicalActivity physicalActivity, boolean willFoster, boolean verified, int verifiedByEmployeeId) { 48 super(dateCreated, name, email, password, telephone); 49 this.freeTime = freeTime; 50 this.funds = funds; 51 this.hasOtherPets = hasOtherPets; 52 this.hasKids = hasKids; 53 this.housing = housing; 54 this.physicalActivity = physicalActivity; 55 this.willFoster = willFoster; 56 this.verified = verified; 57 this.verifiedByEmployeeId = verifiedByEmployeeId; 58 } 59 60 public Adopter(FreeTime freeTime, Funds funds, boolean hasOtherPets, boolean hasKids, Housing housing, 61 PhysicalActivity physicalActivity, boolean willFoster, boolean verified, int verifiedByEmployeeId) { 49 public Adopter(int id, FreeTime freeTime, Funds funds, boolean hasOtherPets, boolean hasKids, Housing housing, PhysicalActivity physicalActivity, boolean willFoster, boolean verified, int verifiedByEmployeeId) { 50 this.id = id; 62 51 this.freeTime = freeTime; 63 52 this.funds = funds; -
Prototype Application/Paw5/src/main/java/finki/paw5/model/Donor.java
r8ae6217 r4885da3 1 1 package finki.paw5.model; 2 2 3 import jakarta.persistence.*; 3 import jakarta.persistence.Column; 4 import jakarta.persistence.Entity; 5 import jakarta.persistence.Id; 6 import jakarta.persistence.Table; 4 7 import lombok.Data; 5 6 import java.time.LocalDate;7 8 8 9 @Data 9 10 @Entity 10 11 @Table(name = "donor") 11 @PrimaryKeyJoinColumn(name = "id_user") 12 public class Donor extends User { 12 public class Donor { 13 14 @Id 15 @Column(name = "id_user", nullable = false) 16 private int id; 13 17 14 18 @Column(name = "is_from_organisation", nullable = false) … … 18 22 private String organisationName; 19 23 20 public Donor(LocalDate dateCreated, String name, String email, String password, String telephone, boolean fromOrganisation, String organisationName) { 21 super(dateCreated, name, email, password, telephone); 22 this.fromOrganisation = fromOrganisation; 23 this.organisationName = organisationName; 24 } 25 26 public Donor(boolean fromOrganisation, String organisationName) { 24 public Donor(int id, boolean fromOrganisation, String organisationName) { 25 this.id = id; 27 26 this.fromOrganisation = fromOrganisation; 28 27 this.organisationName = organisationName; … … 31 30 public Donor() { 32 31 } 33 34 32 } -
Prototype Application/Paw5/src/main/java/finki/paw5/model/Employee.java
r8ae6217 r4885da3 1 1 package finki.paw5.model; 2 2 3 import jakarta.persistence.*; 3 import jakarta.persistence.Column; 4 import jakarta.persistence.Entity; 5 import jakarta.persistence.Id; 6 import jakarta.persistence.Table; 4 7 import lombok.Data; 5 6 import java.time.LocalDate;7 8 8 9 @Data 9 10 @Entity 10 11 @Table(name = "employee") 11 @PrimaryKeyJoinColumn(name = "id_user") 12 public class Employee extends User { 12 public class Employee { 13 14 @Id 15 @Column(name = "id_user", nullable = false) 16 private int id; 13 17 14 18 @Column(name = "position_employee", nullable = false, length = 20) … … 24 28 private int verifiedByAdminId; 25 29 26 public Employee(LocalDate dateCreated, String name, String email, String password, String telephone, 27 String position, int shelterId, boolean verified, int verifiedByAdminId) { 28 super(dateCreated, name, email, password, telephone); 30 public Employee() { 31 32 } 33 34 public Employee(int id, String position, int shelterId, boolean verified, int verifiedByAdminId) { 35 this.id = id; 29 36 this.position = position; 30 37 this.shelterId = shelterId; … … 33 40 } 34 41 35 public Employee(String position, int shelterId, boolean verified, int verifiedByAdminId) {36 this.position = position;37 this.shelterId = shelterId;38 this.verified = verified;39 this.verifiedByAdminId = verifiedByAdminId;40 }41 42 public Employee() {43 44 }45 46 42 } -
Prototype Application/Paw5/src/main/java/finki/paw5/model/Surendee.java
r8ae6217 r4885da3 1 1 package finki.paw5.model; 2 2 3 import jakarta.persistence.*; 3 import jakarta.persistence.Column; 4 import jakarta.persistence.Entity; 5 import jakarta.persistence.Id; 6 import jakarta.persistence.Table; 4 7 import lombok.Data; 5 6 import java.time.LocalDate;7 8 8 9 @Data 9 10 @Entity 10 11 @Table(name = "surendee") 11 @PrimaryKeyJoinColumn(name = "id_user") 12 public class Surendee extends User { 12 public class Surendee { 13 13 14 public Surendee(LocalDate dateCreated, String name, String email, String password, String telephone) { 15 super(dateCreated, name, email, password, telephone); 14 @Id 15 @Column(name = "id_user", nullable = false) 16 private int id; 17 18 public Surendee(int id) { 19 this.id = id; 16 20 } 17 21 18 22 public Surendee() { 19 23 } 20 21 24 } -
Prototype Application/Paw5/src/main/java/finki/paw5/model/User.java
r8ae6217 r4885da3 1 1 package finki.paw5.model; 2 2 3 import jakarta.persistence.*; 3 import jakarta.persistence.Column; 4 import jakarta.persistence.Entity; 5 import jakarta.persistence.Id; 6 import jakarta.persistence.Table; 4 7 import lombok.Data; 5 8 … … 10 13 @Entity 11 14 @Table(name = "user_table") 12 @Inheritance(strategy = InheritanceType.JOINED)13 15 public class User { 14 16 15 17 @Id 16 18 @Column(name = "id_user") 17 pr otectedint id;19 private int id; 18 20 19 21 @Column(name = "date_created_user", nullable = false) 20 pr otectedLocalDate dateCreated;22 private LocalDate dateCreated; 21 23 22 24 @Column(name = "name_user", nullable = false, length = 100) 23 pr otectedString name;25 private String name; 24 26 25 @Column(name = "email_user", nullable = false, length = 100, unique =true)26 pr otectedString email;27 @Column(name = "email_user", nullable = false, length = 100, unique=true) 28 private String email; 27 29 28 30 @Column(name = "password_user", nullable = false, length = 20) 29 pr otectedString password;31 private String password; 30 32 31 33 @Column(name = "telephone_user", length = 20) 32 pr otectedString telephone;34 private String telephone; 33 35 34 36 public User(LocalDate dateCreated, String name, String email, String password, String telephone) {
Note:
See TracChangeset
for help on using the changeset viewer.