Code: Select all
@Entity
@Inheritance(strategy = InheritanceType.JOINED)
@Table(name = "CHP_CUSTOMER")
@Cache(usage = CacheConcurrencyStrategy.NONSTRICT_READ_WRITE, region="blStandardElements")
public class CHPCustomerImpl extends CustomerImpl implements CHPCustomer {
private static final long serialVersionUID = 1L;
@Column(name = "FULL_NAME")
@AdminPresentation(friendlyName = "CustomerImpl_UserName", order=1, prominent=true)
protected String fullname;
@ManyToOne(targetEntity = OrgnizationImpl.class)
@JoinColumn(name = "ORG_ID")
@AdminPresentation(friendlyName = "", order=2, prominent=true)
protected Orgnization orgnization;
@Column(name = "CUSTOMER_CODE")
@AdminPresentation(friendlyName = "", order=2, prominent=true)
protected String customerCode;
@Column(name = "INVOICE_TITLE")
@AdminPresentation(friendlyName = "", order=2,prominent=true)
protected String invoiceTitle;
@Column(name = "IS_APPROVED")
@AdminPresentation(friendlyName = "", prominent=true)
protected Boolean approved = false;
@ManyToOne(targetEntity = AdminUserImpl.class)
@JoinColumn(name = "APPROVED_BY")
@AdminPresentation(friendlyName = "", order=2, prominent=true)
protected AdminUser approvedBy;
@Column(name = "DATE_APPROVED")
@AdminPresentation(friendlyName = "", prominent=true)
protected Date dateApproved;
@Override
public String getFullname() {
return this.fullname;
}
@Override
public void setFullname(String fullname) {
this.fullname = fullname;
}
@Override
public Orgnization getOrgnization() {
return this.orgnization;
}
@Override
public void setOrgnization(Orgnization orgnization) {
this.orgnization = orgnization;
}
@Override
public String getInvoiceTitle() {
return this.invoiceTitle;
}
@Override
public void setInvoiceTitle(String invoiceTitle) {
this.invoiceTitle = invoiceTitle;
}
@Override
public Date getDateApproved() {
return this.dateApproved;
}
@Override
public void setDateApproved(Date dateApproved) {
this.dateApproved = dateApproved;
}
@Override
public AdminUser getApprovedBy() {
return this.approvedBy;
}
@Override
public void setApprovedBy(AdminUser adminUser) {
this.approvedBy = adminUser;
}
@Override
public boolean isApproved() {
return approved;
}
@Override
public void setApproved(boolean approved) {
this.approved = approved;
}
@Override
public boolean equals(Object obj) {
if (this == obj) {
return true;
}
if (obj == null) {
return false;
}
if (getClass() != obj.getClass()) {
return false;
}
CHPCustomerImpl other = (CHPCustomerImpl) obj;
if (id != null && other.id != null) {
return id.equals(other.id);
}
if (fullname == null) {
if (other.fullname != null) {
return false;
}
} else if (!fullname.equals(other.fullname)) {
return false;
}
return true;
}
@Override
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result + ((fullname == null) ? 0 : fullname.hashCode());
return result;
}
The front site runs well, and a customer registered.
But on the Admin UI, duplicated items displayed.
What happens? And how to correct it?
Thanks.