package com.eksad.masterdata.domain; import com.eksad.ddms.common.util.object.EntityObject; import com.eksad.ddms.common.util.status.DataStatus; import jakarta.persistence.*; import javax.validation.constraints.NotNull; import java.util.Objects; @Entity @Table(name = "MST_PROMOCUSTOMERJOB") public class PromoCustomerJob implements EntityObject { @Id @GeneratedValue(strategy = GenerationType.SEQUENCE) Integer id; @NotNull(message = "promo cust job id cannot be null") private String promoCustJobID; @NotNull(message = "promo id cannot be null") private String promoID; @NotNull(message = "job id cannot be null") private String custJobID; private String custJobName; @Enumerated(EnumType.STRING) private DataStatus promoCustJobStatus; @Embedded private CreationalSpecification promoCustJobCreational; public PromoCustomerJob() { } public PromoCustomerJob(String promoCustJobID, String promoID, String custJobID, String custJobName, DataStatus promoCustJobStatus, CreationalSpecification promoCustJobCreational) { this.promoCustJobID = promoCustJobID; this.promoID = promoID; this.custJobID = custJobID; this.custJobName = custJobName; this.promoCustJobStatus = promoCustJobStatus; this.promoCustJobCreational = promoCustJobCreational; } public String getCustJobName() { return custJobName; } public void setCustJobName(String custJobName) { this.custJobName = custJobName; } public Integer getId() { return id; } public void setId(Integer id) { this.id = id; } public String getPromoCustJobID() { return promoCustJobID; } public void setPromoCustJobID(String promoCustJobID) { this.promoCustJobID = promoCustJobID; } public String getPromoID() { return promoID; } public void setPromoID(String promoID) { this.promoID = promoID; } public String getCustJobID() { return custJobID; } public void setCustJobID(String custJobID) { this.custJobID = custJobID; } public DataStatus getPromoCustJobStatus() { return promoCustJobStatus; } public void setPromoCustJobStatus(DataStatus promoCustJobStatus) { this.promoCustJobStatus = promoCustJobStatus; } public CreationalSpecification getPromoCustJobCreational() { return promoCustJobCreational; } public void setPromoCustJobCreational(CreationalSpecification promoCustJobCreational) { this.promoCustJobCreational = promoCustJobCreational; } @Override public int hashCode() { int hash = 5; hash = 17 * hash + Objects.hashCode(this.promoCustJobID); hash = 17 * hash + Objects.hashCode(this.promoID); hash = 17 * hash + Objects.hashCode(this.custJobID); hash = 17 * hash + Objects.hashCode(this.custJobName); hash = 17 * hash + Objects.hashCode(this.promoCustJobStatus); hash = 17 * hash + Objects.hashCode(this.promoCustJobCreational); return hash; } @Override public boolean equals(Object obj) { if (this == obj) { return true; } if (obj == null) { return false; } if (getClass() != obj.getClass()) { return false; } final PromoCustomerJob other = (PromoCustomerJob) obj; if (!Objects.equals(this.promoCustJobID, other.promoCustJobID)) { return false; } if (!Objects.equals(this.promoID, other.promoID)) { return false; } if (!Objects.equals(this.custJobID, other.custJobID)) { return false; } if (!Objects.equals(this.custJobName, other.custJobName)) { return false; } if (this.promoCustJobStatus != other.promoCustJobStatus) { return false; } if (!Objects.equals(this.promoCustJobCreational, other.promoCustJobCreational)) { return false; } return true; } @Override public boolean sameIdentityAs(PromoCustomerJob t) { return this.equals(t); } }