CensusEntry.java 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. /*
  2. * Copyright (c) Andrew Grant of Carrick Software 19/03/2025, 01:34. All rights reserved.
  3. *
  4. */
  5. package scot.carricksoftware.grants.domains.census;
  6. import jakarta.persistence.*;
  7. import scot.carricksoftware.grants.BaseEntity;
  8. import scot.carricksoftware.grants.domains.people.Person;
  9. import scot.carricksoftware.grants.enums.censusentry.CensusEntryRelationship;
  10. @Entity
  11. public class CensusEntry extends BaseEntity {
  12. private String name;
  13. @SuppressWarnings("JpaDataSourceORMInspection")
  14. @ManyToOne
  15. @JoinColumn(name = "censusEntry_census_id")
  16. private Census census;
  17. @SuppressWarnings("JpaDataSourceORMInspection")
  18. @ManyToOne
  19. @JoinColumn(name = "person_id")
  20. private Person person;
  21. @Enumerated(EnumType.STRING)
  22. private CensusEntryRelationship relationship;
  23. public Person getPerson() {
  24. return person;
  25. }
  26. public void setPerson(Person person) {
  27. this.person = person;
  28. }
  29. public String getName() {
  30. return name;
  31. }
  32. public void setName(String name) {
  33. this.name = name;
  34. }
  35. public Census getCensus() {
  36. return census;
  37. }
  38. public void setCensus(Census census) {
  39. this.census = census;
  40. }
  41. public String toString() {
  42. return census.toString();
  43. }
  44. public CensusEntryRelationship getRelationship() {
  45. return relationship;
  46. }
  47. public void setRelationship(CensusEntryRelationship relationship) {
  48. this.relationship = relationship;
  49. }
  50. }