You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

TBRole.java 6.4KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273
  1. package vn.azteam.tpf.domain;
  2. import com.fasterxml.jackson.annotation.JsonIgnore;
  3. import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
  4. import org.hibernate.annotations.Cache;
  5. import org.hibernate.annotations.CacheConcurrencyStrategy;
  6. import javax.persistence.*;
  7. import org.springframework.data.elasticsearch.annotations.Document;
  8. import java.io.Serializable;
  9. import java.time.Instant;
  10. import java.util.Objects;
  11. /**
  12. * A TBRole.
  13. */
  14. @Entity
  15. @Table(name = "tb_role")
  16. @Cache(usage = CacheConcurrencyStrategy.NONSTRICT_READ_WRITE)
  17. @Document(indexName = "smf_tbrole")
  18. public class TBRole implements Serializable {
  19. private static final long serialVersionUID = 1L;
  20. @Id
  21. @GeneratedValue(strategy = GenerationType.IDENTITY)
  22. private Long id;
  23. @Column(name = "name")
  24. private String name;
  25. @Column(name = "is_all_customer")
  26. private Boolean isAllCustomer;
  27. @Column(name = "is_all_crop")
  28. private Boolean isAllCrop;
  29. @Column(name = "role_level")
  30. private Integer roleLevel;
  31. @ManyToOne
  32. @JsonIgnoreProperties("")
  33. private TBCustomer tbCustomer;
  34. @Column(name = "description")
  35. private String description;
  36. @Column(name = "created_date")
  37. private Instant createdDate;
  38. @Column(name = "modified_date")
  39. private Instant modifiedDate;
  40. @Column(name = "deleted_date")
  41. private Instant deletedDate;
  42. @ManyToOne(fetch=FetchType.LAZY)
  43. @JsonIgnoreProperties("")
  44. @JsonIgnore
  45. @JoinColumn(name = "created_by")
  46. private TBDetailUser createdBy;
  47. @ManyToOne(fetch=FetchType.LAZY)
  48. @JsonIgnoreProperties("")
  49. @JsonIgnore
  50. @JoinColumn(name = "modified_by")
  51. private TBDetailUser modifiedBy;
  52. @ManyToOne(fetch=FetchType.LAZY)
  53. @JsonIgnoreProperties("")
  54. @JsonIgnore
  55. @JoinColumn(name = "deleted_by")
  56. private TBDetailUser deletedBy;
  57. // jhipster-needle-entity-add-field - JHipster will add fields here, do not remove
  58. public Long getId() {
  59. return id;
  60. }
  61. public void setId(Long id) {
  62. this.id = id;
  63. }
  64. public String getName() {
  65. return name;
  66. }
  67. public TBRole name(String name) {
  68. this.name = name;
  69. return this;
  70. }
  71. public void setName(String name) {
  72. this.name = name;
  73. }
  74. public Boolean getIsAllCustomer() {
  75. return isAllCustomer;
  76. }
  77. public TBRole isAllCustomer(Boolean isAllCustomer) {
  78. this.isAllCustomer = isAllCustomer;
  79. return this;
  80. }
  81. public void setIsAllCustomer(Boolean isAllCustomer) {
  82. this.isAllCustomer = isAllCustomer;
  83. }
  84. public Boolean getIsAllCrop() {
  85. return isAllCrop;
  86. }
  87. public TBRole isAllCrop(Boolean isAllCrop) {
  88. this.isAllCrop = isAllCrop;
  89. return this;
  90. }
  91. public void setIsAllCrop(Boolean isAllCrop) {
  92. this.isAllCrop = isAllCrop;
  93. }
  94. public Integer getRoleLevel() {
  95. return roleLevel;
  96. }
  97. public TBRole roleLevel(Integer roleLevel) {
  98. this.roleLevel = roleLevel;
  99. return this;
  100. }
  101. public void setRoleLevel(Integer roleLevel) {
  102. this.roleLevel = roleLevel;
  103. }
  104. public String getDescription() {
  105. return description;
  106. }
  107. public TBRole description(String description) {
  108. this.description = description;
  109. return this;
  110. }
  111. public void setTbCustomer(TBCustomer tbCustomer) {
  112. this.tbCustomer = tbCustomer;
  113. }
  114. public TBCustomer getTbCustomer() {
  115. return tbCustomer;
  116. }
  117. public TBRole tbCustomer(TBCustomer tbCustomer) {
  118. this.tbCustomer = tbCustomer;
  119. return this;
  120. }
  121. public void setDescription(String description) {
  122. this.description = description;
  123. }
  124. public Instant getCreatedDate() {
  125. return createdDate;
  126. }
  127. public TBRole createdDate(Instant createdDate) {
  128. this.createdDate = createdDate;
  129. return this;
  130. }
  131. public void setCreatedDate(Instant createdDate) {
  132. this.createdDate = createdDate;
  133. }
  134. public Instant getModifiedDate() {
  135. return modifiedDate;
  136. }
  137. public TBRole modifiedDate(Instant modifiedDate) {
  138. this.modifiedDate = modifiedDate;
  139. return this;
  140. }
  141. public void setModifiedDate(Instant modifiedDate) {
  142. this.modifiedDate = modifiedDate;
  143. }
  144. public Instant getDeletedDate() {
  145. return deletedDate;
  146. }
  147. public TBRole deletedDate(Instant deletedDate) {
  148. this.deletedDate = deletedDate;
  149. return this;
  150. }
  151. public void setDeletedDate(Instant deletedDate) {
  152. this.deletedDate = deletedDate;
  153. }
  154. public TBDetailUser getCreatedBy() {
  155. return createdBy;
  156. }
  157. public TBRole createdBy(TBDetailUser tBDetailUser) {
  158. this.createdBy = tBDetailUser;
  159. return this;
  160. }
  161. public void setCreatedBy(TBDetailUser tBDetailUser) {
  162. this.createdBy = tBDetailUser;
  163. }
  164. public TBDetailUser getModifiedBy() {
  165. return modifiedBy;
  166. }
  167. public TBRole modifiedBy(TBDetailUser tBDetailUser) {
  168. this.modifiedBy = tBDetailUser;
  169. return this;
  170. }
  171. public void setModifiedBy(TBDetailUser tBDetailUser) {
  172. this.modifiedBy = tBDetailUser;
  173. }
  174. public TBDetailUser getDeletedBy() {
  175. return deletedBy;
  176. }
  177. public TBRole deletedBy(TBDetailUser tBDetailUser) {
  178. this.deletedBy = tBDetailUser;
  179. return this;
  180. }
  181. public void setDeletedBy(TBDetailUser tBDetailUser) {
  182. this.deletedBy = tBDetailUser;
  183. }
  184. // jhipster-needle-entity-add-getters-setters - JHipster will add getters and setters here, do not remove
  185. @Override
  186. public boolean equals(Object o) {
  187. if (this == o) {
  188. return true;
  189. }
  190. if (o == null || getClass() != o.getClass()) {
  191. return false;
  192. }
  193. TBRole tBRole = (TBRole) o;
  194. if (tBRole.getId() == null || getId() == null) {
  195. return false;
  196. }
  197. return Objects.equals(getId(), tBRole.getId());
  198. }
  199. @Override
  200. public int hashCode() {
  201. return Objects.hashCode(getId());
  202. }
  203. @Override
  204. public String toString() {
  205. return "TBRole{" +
  206. "id=" + getId() +
  207. ", name='" + getName() + "'" +
  208. ", description='" + getDescription() + "'" +
  209. ", createdDate='" + getCreatedDate() + "'" +
  210. ", modifiedDate='" + getModifiedDate() + "'" +
  211. ", deletedDate='" + getDeletedDate() + "'" +
  212. "}";
  213. }
  214. }