|
|
@@ -5,9 +5,21 @@
|
|
|
|
|
|
package scot.carricksoftware.grants.domains.people;
|
|
|
|
|
|
+import jakarta.persistence.CascadeType;
|
|
|
import jakarta.persistence.Column;
|
|
|
import jakarta.persistence.Entity;
|
|
|
+import jakarta.persistence.OneToMany;
|
|
|
import scot.carricksoftware.grants.BaseEntity;
|
|
|
+import scot.carricksoftware.grants.domains.census.CensusEntry;
|
|
|
+import scot.carricksoftware.grants.domains.certificates.BirthCertificate;
|
|
|
+import scot.carricksoftware.grants.domains.certificates.DeathCertificate;
|
|
|
+import scot.carricksoftware.grants.domains.certificates.DivorceCertificate;
|
|
|
+import scot.carricksoftware.grants.domains.certificates.MarriageCertificate;
|
|
|
+import scot.carricksoftware.grants.domains.images.PersonImage;
|
|
|
+import scot.carricksoftware.grants.domains.text.PersonText;
|
|
|
+
|
|
|
+import java.util.ArrayList;
|
|
|
+import java.util.List;
|
|
|
|
|
|
@Entity
|
|
|
public class Person extends BaseEntity {
|
|
|
@@ -15,7 +27,6 @@ public class Person extends BaseEntity {
|
|
|
@Column(name = "`first_name`")
|
|
|
private String firstName;
|
|
|
|
|
|
-
|
|
|
@Column(name = "`last_name`")
|
|
|
String lastName;
|
|
|
|
|
|
@@ -25,6 +36,27 @@ public class Person extends BaseEntity {
|
|
|
@Column(name = "`certified_year_of_birth`")
|
|
|
String certifiedYearOfBirth;
|
|
|
|
|
|
+ @OneToMany(mappedBy = "id", cascade = CascadeType.ALL, orphanRemoval = true)
|
|
|
+ private List<BirthCertificate> birthCertificates = new ArrayList<>();
|
|
|
+
|
|
|
+ @OneToMany(mappedBy = "id", cascade = CascadeType.ALL, orphanRemoval = true)
|
|
|
+ private List<DeathCertificate> deathCertificates = new ArrayList<>();
|
|
|
+
|
|
|
+ @OneToMany(mappedBy = "id", cascade = CascadeType.ALL, orphanRemoval = true)
|
|
|
+ private List<MarriageCertificate> marriageCertificates = new ArrayList<>();
|
|
|
+
|
|
|
+ @OneToMany(mappedBy = "id", cascade = CascadeType.ALL, orphanRemoval = true)
|
|
|
+ private List<DivorceCertificate> divorceCertificates = new ArrayList<>();
|
|
|
+
|
|
|
+ @OneToMany(mappedBy = "id", cascade = CascadeType.ALL, orphanRemoval = true)
|
|
|
+ private List<CensusEntry> censusEntries = new ArrayList<>();
|
|
|
+
|
|
|
+ @OneToMany(mappedBy = "id", cascade = CascadeType.ALL, orphanRemoval = true)
|
|
|
+ private List<PersonImage> personImages = new ArrayList<>();
|
|
|
+
|
|
|
+ @OneToMany(mappedBy = "id", cascade = CascadeType.ALL, orphanRemoval = true)
|
|
|
+ private List<PersonText> personTexts = new ArrayList<>();
|
|
|
+
|
|
|
public String getFirstName() {
|
|
|
return firstName;
|
|
|
}
|
|
|
@@ -79,4 +111,60 @@ public class Person extends BaseEntity {
|
|
|
public void setCertifiedYearOfBirth(String certifiedYearOfBirth) {
|
|
|
this.certifiedYearOfBirth = certifiedYearOfBirth;
|
|
|
}
|
|
|
+
|
|
|
+ public List<BirthCertificate> getBirthCertificates() {
|
|
|
+ return birthCertificates;
|
|
|
+ }
|
|
|
+
|
|
|
+ public void setBirthCertificates(List<BirthCertificate> birthCertificates) {
|
|
|
+ this.birthCertificates = birthCertificates;
|
|
|
+ }
|
|
|
+
|
|
|
+ public List<DeathCertificate> getDeathCertificates() {
|
|
|
+ return deathCertificates;
|
|
|
+ }
|
|
|
+
|
|
|
+ public void setDeathCertificates(List<DeathCertificate> deathCertificates) {
|
|
|
+ this.deathCertificates = deathCertificates;
|
|
|
+ }
|
|
|
+
|
|
|
+ public List<MarriageCertificate> getMarriageCertificates() {
|
|
|
+ return marriageCertificates;
|
|
|
+ }
|
|
|
+
|
|
|
+ public void setMarriageCertificates(List<MarriageCertificate> marriageCertificates) {
|
|
|
+ this.marriageCertificates = marriageCertificates;
|
|
|
+ }
|
|
|
+
|
|
|
+ public List<DivorceCertificate> getDivorceCertificates() {
|
|
|
+ return divorceCertificates;
|
|
|
+ }
|
|
|
+
|
|
|
+ public void setDivorceCertificates(List<DivorceCertificate> divorceCertificates) {
|
|
|
+ this.divorceCertificates = divorceCertificates;
|
|
|
+ }
|
|
|
+
|
|
|
+ public List<CensusEntry> getCensusEntries() {
|
|
|
+ return censusEntries;
|
|
|
+ }
|
|
|
+
|
|
|
+ public void setCensusEntries(List<CensusEntry> censusEntries) {
|
|
|
+ this.censusEntries = censusEntries;
|
|
|
+ }
|
|
|
+
|
|
|
+ public List<PersonImage> getPersonImages() {
|
|
|
+ return personImages;
|
|
|
+ }
|
|
|
+
|
|
|
+ public void setPersonImages(List<PersonImage> personImages) {
|
|
|
+ this.personImages = personImages;
|
|
|
+ }
|
|
|
+
|
|
|
+ public List<PersonText> getPersonTexts() {
|
|
|
+ return personTexts;
|
|
|
+ }
|
|
|
+
|
|
|
+ public void setPersonTexts(List<PersonText> personTexts) {
|
|
|
+ this.personTexts = personTexts;
|
|
|
+ }
|
|
|
}
|