80 lines
1.5 KiB
Java
80 lines
1.5 KiB
Java
package com.jasamedika.medifirst2000.entities;
|
|
|
|
import java.io.Serializable;import org.hibernate.envers.Audited;
|
|
import java.util.Date;
|
|
|
|
public class PurchasedTest extends PurchaseParent {
|
|
|
|
private Long testId;
|
|
public Long getTestId() {
|
|
return testId;
|
|
}
|
|
|
|
public void setTestId(Long testId) {
|
|
this.testId = testId;
|
|
}
|
|
|
|
private Long customerId;
|
|
|
|
// an easy initializing constructor
|
|
public PurchasedTest() {
|
|
|
|
}
|
|
|
|
public Long getCustomerId() {
|
|
return customerId;
|
|
}
|
|
|
|
public void setCustomerId(Long customerId) {
|
|
this.customerId = customerId;
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
public boolean equals(Object obj) {
|
|
if (this == obj)
|
|
return true;
|
|
if (obj == null)
|
|
return false;
|
|
if (getClass() != obj.getClass())
|
|
return false;
|
|
PurchasedTest other = (PurchasedTest) obj;
|
|
if (customerId == null) {
|
|
if (other.customerId != null)
|
|
return false;
|
|
} else if (!customerId.equals(other.customerId))
|
|
return false;
|
|
if (purchaseDate == null) {
|
|
if (other.purchaseDate != null)
|
|
return false;
|
|
} else if (!purchaseDate.equals(other.purchaseDate))
|
|
return false;
|
|
return true;
|
|
}
|
|
|
|
@Override
|
|
public int hashCode() {
|
|
final int prime = 31;
|
|
int result = 1;
|
|
result = prime * result + ((customerId == null) ? 0 : customerId.hashCode());
|
|
result = prime * result + ((purchaseDate == null) ? 0 : purchaseDate.hashCode());
|
|
return result;
|
|
}
|
|
|
|
Date purchaseDate;
|
|
|
|
|
|
|
|
public Date getPurchaseDate() {
|
|
return purchaseDate;
|
|
}
|
|
|
|
public void setPurchaseDate(Date purchaseDate) {
|
|
this.purchaseDate = purchaseDate;
|
|
}
|
|
|
|
|
|
|
|
}
|