|
@@ -5,16 +5,27 @@
|
|
|
|
|
|
package scot.carricksoftware.grantswriter.domains.people;
|
|
package scot.carricksoftware.grantswriter.domains.people;
|
|
|
|
|
|
|
|
+import jakarta.persistence.Column;
|
|
import jakarta.persistence.Entity;
|
|
import jakarta.persistence.Entity;
|
|
import scot.carricksoftware.grantswriter.BaseEntity;
|
|
import scot.carricksoftware.grantswriter.BaseEntity;
|
|
|
|
|
|
@Entity
|
|
@Entity
|
|
public class Person extends BaseEntity {
|
|
public class Person extends BaseEntity {
|
|
|
|
|
|
- String firstName;
|
|
|
|
|
|
+ @Column(name = "`first_name`")
|
|
|
|
+ private String firstName;
|
|
|
|
+
|
|
|
|
+ @Column(name = "`last_name`")
|
|
String lastName;
|
|
String lastName;
|
|
|
|
|
|
- @SuppressWarnings("unused")
|
|
|
|
|
|
+ @SuppressWarnings("JpaDataSourceORMInspection")
|
|
|
|
+ @Column(name = "`recorded_year_of_birth`")
|
|
|
|
+ String recordedYearOfBirth;
|
|
|
|
+
|
|
|
|
+ @SuppressWarnings("JpaDataSourceORMInspection")
|
|
|
|
+ @Column(name = "`certified_year_of_birth`")
|
|
|
|
+ String certifiedYearOfBirth;
|
|
|
|
+
|
|
public String getFirstName() {
|
|
public String getFirstName() {
|
|
return firstName;
|
|
return firstName;
|
|
}
|
|
}
|
|
@@ -23,7 +34,6 @@ public class Person extends BaseEntity {
|
|
this.firstName = firstName;
|
|
this.firstName = firstName;
|
|
}
|
|
}
|
|
|
|
|
|
- @SuppressWarnings("unused")
|
|
|
|
public String getLastName() {
|
|
public String getLastName() {
|
|
return lastName;
|
|
return lastName;
|
|
}
|
|
}
|
|
@@ -31,4 +41,48 @@ public class Person extends BaseEntity {
|
|
public void setLastName(String lastName) {
|
|
public void setLastName(String lastName) {
|
|
this.lastName = lastName;
|
|
this.lastName = lastName;
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ @SuppressWarnings("unused")
|
|
|
|
+ public String getRecordedYearOfBirth() {
|
|
|
|
+ return recordedYearOfBirth;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ @SuppressWarnings("unused")
|
|
|
|
+ public void setRecordedYearOfBirth(String recordedYearOfBirth) {
|
|
|
|
+ this.recordedYearOfBirth = recordedYearOfBirth;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ @SuppressWarnings("unused")
|
|
|
|
+ public String getCertifiedYearOfBirth() {
|
|
|
|
+ return certifiedYearOfBirth;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ @SuppressWarnings("unused")
|
|
|
|
+ public void setCertifiedYearOfBirth(String certifiedYearOfBirth) {
|
|
|
|
+ this.certifiedYearOfBirth = certifiedYearOfBirth;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ @Override
|
|
|
|
+ public String toString() {
|
|
|
|
+ StringBuilder builder = new StringBuilder();
|
|
|
|
+ builder.append(this.lastName);
|
|
|
|
+ builder.append(", ");
|
|
|
|
+ builder.append(this.firstName);
|
|
|
|
+ builder.append(", ");
|
|
|
|
+ if (certifiedYearOfBirth != null) {
|
|
|
|
+ builder.append(certifiedYearOfBirth);
|
|
|
|
+ builder.append(" ");
|
|
|
|
+ } else {
|
|
|
|
+ if (recordedYearOfBirth != null) {
|
|
|
|
+ builder.append("(");
|
|
|
|
+ builder.append(recordedYearOfBirth);
|
|
|
|
+ builder.append(")");
|
|
|
|
+ builder.append(" ");
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ builder.append("-");
|
|
|
|
+
|
|
|
|
+ return builder.toString();
|
|
|
|
+ }
|
|
|
|
+
|
|
}
|
|
}
|