Changeset 579bf6d for Prototype Application/Paw5/src
- Timestamp:
- 02/03/23 10:47:25 (21 months ago)
- Branches:
- main
- Children:
- 038c9f7, 1bd0a56, 8ae6217
- Parents:
- fdfc6fa
- 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
rfdfc6fa r579bf6d 1 1 package finki.paw5.model; 2 2 3 import jakarta.persistence.Column; 4 import jakarta.persistence.Entity; 5 import jakarta.persistence.Id; 6 import jakarta.persistence.Table; 3 import jakarta.persistence.*; 7 4 import lombok.Data; 5 6 import java.time.LocalDate; 8 7 9 8 @Data 10 9 @Entity 11 10 @Table(name = "admin_table") 12 public class Admin { 11 @PrimaryKeyJoinColumn(name = "id_user") 12 public class Admin extends User { 13 13 14 @Id 15 @Column(name = "id_user", nullable = false) 16 private int id; 17 18 public Admin(int id) { 19 this.id = id; 14 public Admin(LocalDate dateCreated, String name, String email, String password, String telephone) { 15 super(dateCreated, name, email, password, telephone); 20 16 } 21 17 -
Prototype Application/Paw5/src/main/java/finki/paw5/model/Adopter.java
rfdfc6fa r579bf6d 5 5 import finki.paw5.model.enumerations.Housing; 6 6 import finki.paw5.model.enumerations.PhysicalActivity; 7 import jakarta.persistence.Column; 8 import jakarta.persistence.Entity; 9 import jakarta.persistence.Id; 10 import jakarta.persistence.Table; 7 import jakarta.persistence.*; 11 8 import lombok.Data; 9 10 import java.time.LocalDate; 12 11 13 12 @Data 14 13 @Entity 15 14 @Table(name = "adopter") 16 public class Adopter { 17 18 @Id 19 @Column(name = "id_user", nullable = false) 20 private int id; 15 @PrimaryKeyJoinColumn(name = "id_user") 16 public class Adopter extends User { 21 17 22 18 @Column(name = "free_time") … … 47 43 private int verifiedByEmployeeId; 48 44 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; 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) { 51 62 this.freeTime = freeTime; 52 63 this.funds = funds; -
Prototype Application/Paw5/src/main/java/finki/paw5/model/Donor.java
rfdfc6fa r579bf6d 1 1 package finki.paw5.model; 2 2 3 import jakarta.persistence.Column; 4 import jakarta.persistence.Entity; 5 import jakarta.persistence.Id; 6 import jakarta.persistence.Table; 3 import jakarta.persistence.*; 7 4 import lombok.Data; 5 6 import java.time.LocalDate; 8 7 9 8 @Data 10 9 @Entity 11 10 @Table(name = "donor") 12 public class Donor { 13 14 @Id 15 @Column(name = "id_user", nullable = false) 16 private int id; 11 @PrimaryKeyJoinColumn(name = "id_user") 12 public class Donor extends User { 17 13 18 14 @Column(name = "is_from_organisation", nullable = false) … … 22 18 private String organisationName; 23 19 24 public Donor(int id, boolean fromOrganisation, String organisationName) { 25 this.id = id; 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) { 26 27 this.fromOrganisation = fromOrganisation; 27 28 this.organisationName = organisationName; … … 30 31 public Donor() { 31 32 } 33 32 34 } -
Prototype Application/Paw5/src/main/java/finki/paw5/model/Employee.java
rfdfc6fa r579bf6d 1 1 package finki.paw5.model; 2 2 3 import jakarta.persistence.Column; 4 import jakarta.persistence.Entity; 5 import jakarta.persistence.Id; 6 import jakarta.persistence.Table; 3 import jakarta.persistence.*; 7 4 import lombok.Data; 5 6 import java.time.LocalDate; 8 7 9 8 @Data 10 9 @Entity 11 10 @Table(name = "employee") 12 public class Employee { 13 14 @Id 15 @Column(name = "id_user", nullable = false) 16 private int id; 11 @PrimaryKeyJoinColumn(name = "id_user") 12 public class Employee extends User { 17 13 18 14 @Column(name = "position_employee", nullable = false, length = 20) … … 28 24 private int verifiedByAdminId; 29 25 30 public Employee() { 31 32 } 33 34 public Employee(int id, String position, int shelterId, boolean verified, int verifiedByAdminId) { 35 this.id = id; 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); 36 29 this.position = position; 37 30 this.shelterId = shelterId; … … 40 33 } 41 34 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 42 46 } -
Prototype Application/Paw5/src/main/java/finki/paw5/model/Surendee.java
rfdfc6fa r579bf6d 1 1 package finki.paw5.model; 2 2 3 import jakarta.persistence.Column; 4 import jakarta.persistence.Entity; 5 import jakarta.persistence.Id; 6 import jakarta.persistence.Table; 3 import jakarta.persistence.*; 7 4 import lombok.Data; 5 6 import java.time.LocalDate; 8 7 9 8 @Data 10 9 @Entity 11 10 @Table(name = "surendee") 12 public class Surendee { 11 @PrimaryKeyJoinColumn(name = "id_user") 12 public class Surendee extends User { 13 13 14 @Id 15 @Column(name = "id_user", nullable = false) 16 private int id; 17 18 public Surendee(int id) { 19 this.id = id; 14 public Surendee(LocalDate dateCreated, String name, String email, String password, String telephone) { 15 super(dateCreated, name, email, password, telephone); 20 16 } 21 17 22 18 public Surendee() { 23 19 } 20 24 21 } -
Prototype Application/Paw5/src/main/java/finki/paw5/model/User.java
rfdfc6fa r579bf6d 1 1 package finki.paw5.model; 2 2 3 import jakarta.persistence.Column; 4 import jakarta.persistence.Entity; 5 import jakarta.persistence.Id; 6 import jakarta.persistence.Table; 3 import jakarta.persistence.*; 7 4 import lombok.Data; 8 5 … … 13 10 @Entity 14 11 @Table(name = "user_table") 12 @Inheritance(strategy = InheritanceType.JOINED) 15 13 public class User { 16 14 17 15 @Id 18 16 @Column(name = "id_user") 19 pr ivateint id;17 protected int id; 20 18 21 19 @Column(name = "date_created_user", nullable = false) 22 pr ivateLocalDate dateCreated;20 protected LocalDate dateCreated; 23 21 24 22 @Column(name = "name_user", nullable = false, length = 100) 25 pr ivateString name;23 protected String name; 26 24 27 @Column(name = "email_user", nullable = false, length = 100, unique =true)28 pr ivateString email;25 @Column(name = "email_user", nullable = false, length = 100, unique = true) 26 protected String email; 29 27 30 28 @Column(name = "password_user", nullable = false, length = 20) 31 pr ivateString password;29 protected String password; 32 30 33 31 @Column(name = "telephone_user", length = 20) 34 pr ivateString telephone;32 protected String telephone; 35 33 36 34 public User(LocalDate dateCreated, String name, String email, String password, String telephone) {
Note:
See TracChangeset
for help on using the changeset viewer.