profitloss.java.svn-base

来自「Store Manager」· SVN-BASE 代码 · 共 108 行

SVN-BASE
108
字号
/* * ProfitLoss.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 ProfitLossItem * @author wangs */@Entity@Table(name = "profitloss")@NamedQueries( {@NamedQuery(name = "ProfitLoss.findByProfitLossID", query = "SELECT p FROM ProfitLoss p WHERE p.profitLossID = :profitLossID")})public class ProfitLoss implements Serializable {    @Id    @Column(name = "profitLossID", nullable = false)    @GeneratedValue(strategy=GenerationType.IDENTITY)    private Integer profitLossID;    @JoinColumn(name = "storeName", referencedColumnName = "storeName")    @ManyToOne    private Store storeName;    @OneToMany(cascade = CascadeType.ALL, mappedBy = "profitLossID")    private Collection<ProfitLossItem> profitLossItemCollection;        public ProfitLoss() {    }        public ProfitLoss(Integer profitLossID) {        this.profitLossID = profitLossID;    }        public Integer getProfitLossID() {        return profitLossID;    }        public void setProfitLossID(Integer profitLossID) {        this.profitLossID = profitLossID;    }        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 += (profitLossID != null ? profitLossID.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 ProfitLoss)) {            return false;        }        ProfitLoss other = (ProfitLoss) object;        if (this.profitLossID != other.profitLossID && (this.profitLossID == null || !this.profitLossID.equals(other.profitLossID))) {            return false;        }        return true;    }        @Override    public String toString() {        return "com.studio009.store.entity.ProfitLoss[profitLossID=" + profitLossID + "]";    }    }

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?