/* * To change this template, choose Tools | Templates * and open the template in the editor. */ package stockInformation; import java.io.Serializable; import javax.persistence.CascadeType; import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.Id; import javax.persistence.IdClass; import javax.persistence.JoinColumn; import javax.persistence.ManyToOne; import javax.persistence.Table; /** * * @author eve */ @IdClass(stockInformation.OrdlinementKey.class) @Entity @Table(name="ORDERLINE") public class Ordlineent implements Serializable { private static final long serialVersionUID = 1L; @Id private Long itmid; @Id private Long cusid; @Id private Long ordID; /** @ManyToOne(cascade = {CascadeType.ALL}) @JoinColumn(name="ORDID") private Orderent orderent; @ManyToOne(cascade = {CascadeType.ALL}) @JoinColumn(name="ITEMID") private Iteamdetailsent iteamdetailsent; @ManyToOne(cascade = {CascadeType.ALL}) @JoinColumn(name="CUSID") private Customerent customerent;*/ @Column(name="QUANTITY", nullable=true) private Long quanity; public Long getItmid(){ return itmid;} public void setItmid(Long itmid){ this.itmid=itmid;} public Long getCusid() {return cusid;} public void setCusid(Long cusid){ this.cusid=cusid; } public Long getOrdID(){ return ordID;} public void setOrdID(Long ordID){ this.ordID=ordID;} /** public Orderent getOrderent() { return orderent; } public void setOrderent(Orderent orderent) { this.orderent = orderent; } public Iteamdetailsent getIteamdetailsent() { return iteamdetailsent; } public void setIteamdetailsent(Iteamdetailsent iteamdetailsent) { this.iteamdetailsent = iteamdetailsent; } public Customerent getCustomerent() { return customerent; } public void setCustomerent(Customerent customerent) { this.customerent = customerent; } */ public Long getQuanity() { return quanity; } public void setQuanity(Long quanity) { this.quanity = quanity; } /** @Override public int hashCode() { if (this.getOrderent() == null || this.getIteamdetailsent() == null) { return 0; } else { return (this.getOrderent().hashCode() ^ this.getIteamdetailsent().hashCode()); } } @Override public boolean equals(Object obj) { if (obj == null) { return false; } if (getClass() != obj.getClass()) { return false; } final Ordlineent other = (Ordlineent) obj; if (this.orderent != other.orderent && (this.orderent == null || !this.orderent.equals(other.orderent))) { return false; } if (this.iteamdetailsent != other.iteamdetailsent && (this.iteamdetailsent == null || !this.iteamdetailsent.equals(other.iteamdetailsent))) { return false; } if (this.customerent != other.customerent && (this.customerent == null || !this.customerent.equals(other.customerent))) { return false; } return true; } */ /** @Override public int hashCode() { int hash = 0; hash += (ordID != null ? ordID.hashCode() : 0); return hash; }*/ /** @Override public int hashCode() { int hash = 0; hash += (id != null ? id.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 Ordlineent)) { return false; } Ordlineent other = (Ordlineent) object; if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) { return false; } return true; }*/ @Override public String toString() { return "stockInformation.Ordlineent[id=" + itmid + "]"; } }