storegoods.java
来自「Store Manager」· Java 代码 · 共 145 行
JAVA
145 行
/* * Storegoods.java * * Created on 2007-6-1, 14:22:21 * * To change this template, choose Tools | Template Manager * and open the template in the editor. */package com.studio009.store.entity;import java.io.Serializable;import java.util.Collection;import javax.persistence.CascadeType;import javax.persistence.Column;import javax.persistence.Entity;import javax.persistence.GeneratedValue;import javax.persistence.GenerationType;import javax.persistence.Id;import javax.persistence.JoinColumn;import javax.persistence.ManyToOne;import javax.persistence.NamedQueries;import javax.persistence.NamedQuery;import javax.persistence.OneToMany;import javax.persistence.Table;/** * 库存商品单实体类 * <p> * 该类对应数据库的表, * 数据库每个字段可以找到一个属性. * 详情参加数据库设计书. * </p> * @see Store * @see Goods * @author wangs */@Entity@Table(name = "storegoods")@NamedQueries( {@NamedQuery(name = "Storegoods.findByStoreGoodsID", query = "SELECT s FROM StoreGoods s WHERE s.storeGoodsID = :storeGoodsID"), @NamedQuery(name = "Storegoods.findByStoreGoodsQuantity", query = "SELECT s FROM StoreGoods s WHERE s.storeGoodsQuantity = :storeGoodsQuantity")})public class StoreGoods implements Serializable { @Id @Column(name = "storeGoodsID", nullable = false) @GeneratedValue(strategy=GenerationType.IDENTITY) private Integer storeGoodsID; @Column(name = "storeGoodsQuantity", nullable = false) private double storeGoodsQuantity; @OneToMany(cascade = CascadeType.ALL, mappedBy = "storeGoodsID") private Collection<SaleItem> saleItemCollection; @JoinColumn(name = "goodsID", referencedColumnName = "goodsID") @ManyToOne private Goods goodsID; @JoinColumn(name = "storeName", referencedColumnName = "storeName") @ManyToOne private Store storeName; @OneToMany(cascade = CascadeType.ALL, mappedBy = "storeGoodsID") private Collection<ProfitLossItem> profitLossItemCollection; public StoreGoods() { } public StoreGoods(Integer storeGoodsID) { this.storeGoodsID = storeGoodsID; } public StoreGoods(Integer storeGoodsID, double storeGoodsQuantity) { this.storeGoodsID = storeGoodsID; this.storeGoodsQuantity = storeGoodsQuantity; } public Integer getStoreGoodsID() { return storeGoodsID; } public void setStoreGoodsID(Integer storeGoodsID) { this.storeGoodsID = storeGoodsID; } public double getStoreGoodsQuantity() { return storeGoodsQuantity; } public void setStoreGoodsQuantity(double storeGoodsQuantity) { this.storeGoodsQuantity = storeGoodsQuantity; } public Collection<SaleItem> getSaleItemCollection() { return saleItemCollection; } public void setSaleItemCollection(Collection<SaleItem> saleItemCollection) { this.saleItemCollection = saleItemCollection; } public Goods getGoodsID() { return goodsID; } public void setGoodsID(Goods goodsID) { this.goodsID = goodsID; } public Store getStoreName() { return storeName; } public void setStoreName(Store storeName) { this.storeName = storeName; } public Collection<ProfitLossItem> getProfitLossItemCollection() { return profitLossItemCollection; } public void setProfitLossItemCollection(Collection<ProfitLossItem> profitLossItemCollection) { this.profitLossItemCollection = profitLossItemCollection; } @Override public int hashCode() { int hash = 0; hash += (storeGoodsID != null ? storeGoodsID.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 StoreGoods)) { return false; } StoreGoods other = (StoreGoods) object; if (this.storeGoodsID != other.storeGoodsID && (this.storeGoodsID == null || !this.storeGoodsID.equals(other.storeGoodsID))) { return false; } return true; } @Override public String toString() { return "com.studio009.store.entity.Storegoods[storeGoodsID=" + storeGoodsID + "]"; }}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?