Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.

150 rindas
3.4KB

  1. package vn.azteam.tpf.domain;
  2. import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
  3. import org.hibernate.annotations.Cache;
  4. import org.hibernate.annotations.CacheConcurrencyStrategy;
  5. import javax.persistence.*;
  6. import org.springframework.data.elasticsearch.annotations.Document;
  7. import java.io.Serializable;
  8. import java.util.Objects;
  9. /**
  10. * A TBAddress.
  11. */
  12. @Entity
  13. @Table(name = "tb_address")
  14. @Cache(usage = CacheConcurrencyStrategy.NONSTRICT_READ_WRITE)
  15. @Document(indexName = "smf_tbaddress")
  16. public class TBAddress implements Serializable {
  17. private static final long serialVersionUID = 1L;
  18. @Id
  19. @GeneratedValue(strategy = GenerationType.IDENTITY)
  20. private Long id;
  21. @Column(name = "address")
  22. private String address;
  23. @ManyToOne
  24. @JsonIgnoreProperties({"hibernateLazyInitializer", "handler"})
  25. private TBCountry tbCountry;
  26. @ManyToOne
  27. @JsonIgnoreProperties({"hibernateLazyInitializer", "handler"})
  28. private TBCity tbCity;
  29. @ManyToOne
  30. @JsonIgnoreProperties({"hibernateLazyInitializer", "handler"})
  31. private TBDistrict tbDistrict;
  32. @ManyToOne
  33. @JsonIgnoreProperties({"hibernateLazyInitializer", "handler"})
  34. private TBWard tbWard;
  35. // jhipster-needle-entity-add-field - JHipster will add fields here, do not remove
  36. public Long getId() {
  37. return id;
  38. }
  39. public void setId(Long id) {
  40. this.id = id;
  41. }
  42. public String getAddress() {
  43. return address;
  44. }
  45. public TBAddress address(String address) {
  46. this.address = address;
  47. return this;
  48. }
  49. public void setAddress(String address) {
  50. this.address = address;
  51. }
  52. public TBCountry getTbCountry() {
  53. return tbCountry;
  54. }
  55. public TBAddress tbCountry(TBCountry tBCountry) {
  56. this.tbCountry = tBCountry;
  57. return this;
  58. }
  59. public void setTbCountry(TBCountry tBCountry) {
  60. this.tbCountry = tBCountry;
  61. }
  62. public TBCity getTbCity() {
  63. return tbCity;
  64. }
  65. public TBAddress tbCity(TBCity tBCity) {
  66. this.tbCity = tBCity;
  67. return this;
  68. }
  69. public void setTbCity(TBCity tBCity) {
  70. this.tbCity = tBCity;
  71. }
  72. public TBDistrict getTbDistrict() {
  73. return tbDistrict;
  74. }
  75. public TBAddress tbDistrict(TBDistrict tBDistrict) {
  76. this.tbDistrict = tBDistrict;
  77. return this;
  78. }
  79. public void setTbDistrict(TBDistrict tBDistrict) {
  80. this.tbDistrict = tBDistrict;
  81. }
  82. public TBWard getTbWard() {
  83. return tbWard;
  84. }
  85. public TBAddress tbWard(TBWard tBWard) {
  86. this.tbWard = tBWard;
  87. return this;
  88. }
  89. public void setTbWard(TBWard tBWard) {
  90. this.tbWard = tBWard;
  91. }
  92. // jhipster-needle-entity-add-getters-setters - JHipster will add getters and setters here, do not remove
  93. @Override
  94. public boolean equals(Object o) {
  95. if (this == o) {
  96. return true;
  97. }
  98. if (o == null || getClass() != o.getClass()) {
  99. return false;
  100. }
  101. TBAddress tBAddress = (TBAddress) o;
  102. if (tBAddress.getId() == null || getId() == null) {
  103. return false;
  104. }
  105. return Objects.equals(getId(), tBAddress.getId());
  106. }
  107. @Override
  108. public int hashCode() {
  109. return Objects.hashCode(getId());
  110. }
  111. @Override
  112. public String toString() {
  113. return "TBAddress{" +
  114. "id=" + getId() +
  115. ", address='" + getAddress() + "'" +
  116. "}";
  117. }
  118. }