|
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273 |
- package vn.azteam.tpf.domain;
-
- import com.fasterxml.jackson.annotation.JsonIgnore;
- import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
- import org.hibernate.annotations.Cache;
- import org.hibernate.annotations.CacheConcurrencyStrategy;
-
- import javax.persistence.*;
-
- import org.springframework.data.elasticsearch.annotations.Document;
- import java.io.Serializable;
- import java.time.Instant;
- import java.util.Objects;
-
- /**
- * A TBRole.
- */
- @Entity
- @Table(name = "tb_role")
- @Cache(usage = CacheConcurrencyStrategy.NONSTRICT_READ_WRITE)
- @Document(indexName = "smf_tbrole")
- public class TBRole implements Serializable {
-
- private static final long serialVersionUID = 1L;
-
- @Id
- @GeneratedValue(strategy = GenerationType.IDENTITY)
- private Long id;
-
- @Column(name = "name")
- private String name;
-
- @Column(name = "is_all_customer")
- private Boolean isAllCustomer;
-
- @Column(name = "is_all_crop")
- private Boolean isAllCrop;
-
- @Column(name = "role_level")
- private Integer roleLevel;
-
- @ManyToOne
- @JsonIgnoreProperties("")
- private TBCustomer tbCustomer;
-
- @Column(name = "description")
- private String description;
-
- @Column(name = "created_date")
- private Instant createdDate;
-
- @Column(name = "modified_date")
- private Instant modifiedDate;
-
- @Column(name = "deleted_date")
- private Instant deletedDate;
-
- @ManyToOne(fetch=FetchType.LAZY)
- @JsonIgnoreProperties("")
- @JsonIgnore
- @JoinColumn(name = "created_by")
- private TBDetailUser createdBy;
-
- @ManyToOne(fetch=FetchType.LAZY)
- @JsonIgnoreProperties("")
- @JsonIgnore
- @JoinColumn(name = "modified_by")
- private TBDetailUser modifiedBy;
-
- @ManyToOne(fetch=FetchType.LAZY)
- @JsonIgnoreProperties("")
- @JsonIgnore
- @JoinColumn(name = "deleted_by")
- private TBDetailUser deletedBy;
-
- // jhipster-needle-entity-add-field - JHipster will add fields here, do not remove
- public Long getId() {
- return id;
- }
-
- public void setId(Long id) {
- this.id = id;
- }
-
- public String getName() {
- return name;
- }
-
- public TBRole name(String name) {
- this.name = name;
- return this;
- }
-
- public void setName(String name) {
- this.name = name;
- }
-
- public Boolean getIsAllCustomer() {
- return isAllCustomer;
- }
-
- public TBRole isAllCustomer(Boolean isAllCustomer) {
- this.isAllCustomer = isAllCustomer;
- return this;
- }
-
- public void setIsAllCustomer(Boolean isAllCustomer) {
- this.isAllCustomer = isAllCustomer;
- }
-
- public Boolean getIsAllCrop() {
- return isAllCrop;
- }
-
- public TBRole isAllCrop(Boolean isAllCrop) {
- this.isAllCrop = isAllCrop;
- return this;
- }
-
- public void setIsAllCrop(Boolean isAllCrop) {
- this.isAllCrop = isAllCrop;
- }
-
- public Integer getRoleLevel() {
- return roleLevel;
- }
-
- public TBRole roleLevel(Integer roleLevel) {
- this.roleLevel = roleLevel;
- return this;
- }
-
- public void setRoleLevel(Integer roleLevel) {
- this.roleLevel = roleLevel;
- }
-
- public String getDescription() {
- return description;
- }
-
- public TBRole description(String description) {
- this.description = description;
- return this;
- }
-
- public void setTbCustomer(TBCustomer tbCustomer) {
- this.tbCustomer = tbCustomer;
- }
-
- public TBCustomer getTbCustomer() {
- return tbCustomer;
- }
-
- public TBRole tbCustomer(TBCustomer tbCustomer) {
- this.tbCustomer = tbCustomer;
- return this;
- }
-
- public void setDescription(String description) {
- this.description = description;
- }
-
- public Instant getCreatedDate() {
- return createdDate;
- }
-
- public TBRole createdDate(Instant createdDate) {
- this.createdDate = createdDate;
- return this;
- }
-
- public void setCreatedDate(Instant createdDate) {
- this.createdDate = createdDate;
- }
-
- public Instant getModifiedDate() {
- return modifiedDate;
- }
-
- public TBRole modifiedDate(Instant modifiedDate) {
- this.modifiedDate = modifiedDate;
- return this;
- }
-
- public void setModifiedDate(Instant modifiedDate) {
- this.modifiedDate = modifiedDate;
- }
-
- public Instant getDeletedDate() {
- return deletedDate;
- }
-
- public TBRole deletedDate(Instant deletedDate) {
- this.deletedDate = deletedDate;
- return this;
- }
-
- public void setDeletedDate(Instant deletedDate) {
- this.deletedDate = deletedDate;
- }
-
- public TBDetailUser getCreatedBy() {
- return createdBy;
- }
-
- public TBRole createdBy(TBDetailUser tBDetailUser) {
- this.createdBy = tBDetailUser;
- return this;
- }
-
- public void setCreatedBy(TBDetailUser tBDetailUser) {
- this.createdBy = tBDetailUser;
- }
-
- public TBDetailUser getModifiedBy() {
- return modifiedBy;
- }
-
- public TBRole modifiedBy(TBDetailUser tBDetailUser) {
- this.modifiedBy = tBDetailUser;
- return this;
- }
-
- public void setModifiedBy(TBDetailUser tBDetailUser) {
- this.modifiedBy = tBDetailUser;
- }
-
- public TBDetailUser getDeletedBy() {
- return deletedBy;
- }
-
- public TBRole deletedBy(TBDetailUser tBDetailUser) {
- this.deletedBy = tBDetailUser;
- return this;
- }
-
- public void setDeletedBy(TBDetailUser tBDetailUser) {
- this.deletedBy = tBDetailUser;
- }
- // jhipster-needle-entity-add-getters-setters - JHipster will add getters and setters here, do not remove
-
- @Override
- public boolean equals(Object o) {
- if (this == o) {
- return true;
- }
- if (o == null || getClass() != o.getClass()) {
- return false;
- }
- TBRole tBRole = (TBRole) o;
- if (tBRole.getId() == null || getId() == null) {
- return false;
- }
- return Objects.equals(getId(), tBRole.getId());
- }
-
- @Override
- public int hashCode() {
- return Objects.hashCode(getId());
- }
-
- @Override
- public String toString() {
- return "TBRole{" +
- "id=" + getId() +
- ", name='" + getName() + "'" +
- ", description='" + getDescription() + "'" +
- ", createdDate='" + getCreatedDate() + "'" +
- ", modifiedDate='" + getModifiedDate() + "'" +
- ", deletedDate='" + getDeletedDate() + "'" +
- "}";
- }
- }
|