📄 store.java.svn-base
字号:
/* * Store.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.Id;import javax.persistence.NamedQueries;import javax.persistence.NamedQuery;import javax.persistence.OneToMany;import javax.persistence.Table;/** * 仓库实体类 * <p> * 该类对应数据库的表, * 数据库每个字段可以找到一个属性. * 详情参加数据库设计书. * </p> * @see StoreGoods * @author wangs */@Entity@Table(name = "store")@NamedQueries( {@NamedQuery(name = "Store.findByStoreName", query = "SELECT s FROM Store s WHERE s.storeName = :storeName"), @NamedQuery(name = "Store.findByStoreAddress", query = "SELECT s FROM Store s WHERE s.storeAddress = :storeAddress"), @NamedQuery(name = "Store.findByStoreNote", query = "SELECT s FROM Store s WHERE s.storeNote = :storeNote")})public class Store implements Serializable { @Id @Column(name = "storeName", nullable = false) private String storeName; @Column(name = "storeAddress") private String storeAddress; @Column(name = "storeNote") private String storeNote; @OneToMany(cascade = CascadeType.ALL, mappedBy = "storeName") private Collection<StoreGoods> storegoodsCollection; @OneToMany(cascade = CascadeType.ALL, mappedBy = "storeName") private Collection<ProfitLoss> profitLossCollection; @OneToMany(cascade = CascadeType.ALL, mappedBy = "storeName") private Collection<Stock> stockCollection; public Store() { } public Store(String storeName) { this.storeName = storeName; } public String getStoreName() { return storeName; } public void setStoreName(String storeName) { this.storeName = storeName; } public String getStoreAddress() { return storeAddress; } public void setStoreAddress(String storeAddress) { this.storeAddress = storeAddress; } public String getStoreNote() { return storeNote; } public void setStoreNote(String storeNote) { this.storeNote = storeNote; } public Collection<StoreGoods> getStoregoodsCollection() { return storegoodsCollection; } public void setStoregoodsCollection(Collection<StoreGoods> storegoodsCollection) { this.storegoodsCollection = storegoodsCollection; } public Collection<ProfitLoss> getProfitLossCollection() { return profitLossCollection; } public void setProfitLossCollection(Collection<ProfitLoss> profitLossCollection) { this.profitLossCollection = profitLossCollection; } public Collection<Stock> getStockCollection() { return stockCollection; } public void setStockCollection(Collection<Stock> stockCollection) { this.stockCollection = stockCollection; } @Override public int hashCode() { int hash = 0; hash += (storeName != null ? storeName.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 Store)) { return false; } Store other = (Store) object; if (this.storeName != other.storeName && (this.storeName == null || !this.storeName.equals(other.storeName))) { return false; } return true; } @Override public String toString() { return "com.studio009.store.entity.Store[storeName=" + storeName + "]"; }}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -