profitlossitem.java

来自「Store Manager」· Java 代码 · 共 132 行

JAVA
132
字号
/* * ProfitLossItem.java * * Created on 2007-6-1, 14:22:22 * * 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 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.Table;/** * 损益单明细实体类 * <p> * 该类对应数据库的表, * 数据库每个字段可以找到一个属性. * 详情参加数据库设计书. * </p> * @see ProfitLoss * @author wangs */@Entity@Table(name = "profitlossitem")@NamedQueries( {@NamedQuery(name = "ProfitLossItem.findByProfitLossItemID", query = "SELECT p FROM ProfitLossItem p WHERE p.profitLossItemID = :profitLossItemID"), @NamedQuery(name = "ProfitLossItem.findByProfitOrLoss", query = "SELECT p FROM ProfitLossItem p WHERE p.profitOrLoss = :profitOrLoss"), @NamedQuery(name = "ProfitLossItem.findByProfitlossitemQuantity", query = "SELECT p FROM ProfitLossItem p WHERE p.profitlossitemQuantity = :profitlossitemQuantity")})public class ProfitLossItem implements Serializable {    @Id    @Column(name = "profitLossItemID", nullable = false)    @GeneratedValue(strategy=GenerationType.IDENTITY)    private Integer profitLossItemID;    @Column(name = "profitOrLoss", nullable = false)    private int profitOrLoss;    @Column(name = "profitlossitemQuantity", nullable = false)    private double profitlossitemQuantity;    @JoinColumn(name = "profitLossID", referencedColumnName = "profitLossID")    @ManyToOne    private ProfitLoss profitLossID;    @JoinColumn(name = "storeGoodsID", referencedColumnName = "storeGoodsID")    @ManyToOne    private StoreGoods storeGoodsID;        public ProfitLossItem() {    }        public ProfitLossItem(Integer profitLossItemID) {        this.profitLossItemID = profitLossItemID;    }        public ProfitLossItem(Integer profitLossItemID, int profitOrLoss, int profitlossitemQuantity) {        this.profitLossItemID = profitLossItemID;        this.profitOrLoss = profitOrLoss;        this.profitlossitemQuantity = profitlossitemQuantity;    }        public Integer getProfitLossItemID() {        return profitLossItemID;    }        public void setProfitLossItemID(Integer profitLossItemID) {        this.profitLossItemID = profitLossItemID;    }        public int getProfitOrLoss() {        return profitOrLoss;    }        public void setProfitOrLoss(int profitOrLoss) {        this.profitOrLoss = profitOrLoss;    }        public double getProfitlossitemQuantity() {        return profitlossitemQuantity;    }        public void setProfitlossitemQuantity(double profitlossitemQuantity) {        this.profitlossitemQuantity = profitlossitemQuantity;    }        public ProfitLoss getProfitLossID() {        return profitLossID;    }        public void setProfitLossID(ProfitLoss profitLossID) {        this.profitLossID = profitLossID;    }        public StoreGoods getStoreGoodsID() {        return storeGoodsID;    }        public void setStoreGoodsID(StoreGoods storeGoodsID) {        this.storeGoodsID = storeGoodsID;    }        @Override    public int hashCode() {        int hash = 0;        hash += (profitLossItemID != null ? profitLossItemID.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 ProfitLossItem)) {            return false;        }        ProfitLossItem other = (ProfitLossItem) object;        if (this.profitLossItemID != other.profitLossItemID && (this.profitLossItemID == null || !this.profitLossItemID.equals(other.profitLossItemID))) {            return false;        }        return true;    }        @Override    public String toString() {        return "com.studio009.store.entity.ProfitLossItem[profitLossItemID=" + profitLossItemID + "]";    }    }

⌨️ 快捷键说明

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