@Entity
@Table(name = "contract_property", catalog = "varad1", schema = "")
@NamedQueries({@NamedQuery(name = "ContractProperty.findAll",
query = "SELECT c FROM ContractProperty c"),
@NamedQuery(name = "ContractProperty.findByContractpropertyID",
query = "SELECT c FROM ContractProperty c WHERE c.contractpropertyID" +
" = :contractpropertyID"),
@NamedQuery(name = "ContractProperty.findByCreated",
query = "SELECT c FROM ContractProperty c WHERE c.created = :created"),
@NamedQuery(name = "ContractProperty.findByUpdated",
query = "SELECT c FROM ContractProperty c WHERE c.updated = :updated")})
public class ContractProperty implements Serializable {
private static final long serialVersionUID = 1L;
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Basic(optional = false)
@Column(name = "contract_property_ID")
private Integer contractpropertyID;
@Basic(optional = false)
@Column(name = "created")
@Temporal(TemporalType.TIMESTAMP)
private Date created;
@Column(name = "updated")
@Temporal(TemporalType.DATE)
private Date updated;
@JoinColumn(name = "property_ID", referencedColumnName = "property_ID")
@ManyToOne(optional = false)
private Property propertyID;
@JoinColumn(name = "contract_ID", referencedColumnName = "contract_ID")
@ManyToOne(optional = false)
private Contract contractID;
@JoinColumn(name = "created_by", referencedColumnName = "employee_ID")
@ManyToOne(optional = false)
private Employee createdBy;
@JoinColumn(name = "updated_by", referencedColumnName = "employee_ID")
@ManyToOne
private Employee updatedBy;
public ContractProperty() {
}
public ContractProperty(Integer contractpropertyID) {
this.contractpropertyID = contractpropertyID;
}
public ContractProperty(Integer contractpropertyID, Date created) {
this.contractpropertyID = contractpropertyID;
this.created = created;
}
public Integer getContractpropertyID() {
return contractpropertyID;
}
public void setContractpropertyID(Integer contractpropertyID) {
this.contractpropertyID = contractpropertyID;
}
-more stuff-
public Property getPropertyID() {
return propertyID;
}
public void setPropertyID(Property propertyID) {
this.propertyID = propertyID;
}
public Contract getContractID() {
return contractID;
}
public void setContractID(Contract contractID) {
this.contractID = contractID;
}
@Override
public int hashCode() {
int hash = 0;
hash += (contractpropertyID != null ? contractpropertyID.hashCode() : 0);
return hash;
}
@Override
public boolean equals(Object object) {
// TODO: Warning - this method won't work in the case the id fields are not set
if (!(object instanceof ContractProperty)) {
return false;
}
ContractProperty other = (ContractProperty) object;
if ((this.contractpropertyID == null && other.contractpropertyID != null)
|| (this.contractpropertyID != null &&
!this.contractpropertyID.equals(other.contractpropertyID))) {
return false;
}
return true;
}
}