supplier.java.svn-base

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

SVN-BASE
121
字号
/* * Supplier.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 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> * @author wangs */@Entity@Table(name = "supplier")@NamedQueries( {@NamedQuery(name = "Supplier.findBySupplierName", query = "SELECT s FROM Supplier s WHERE s.supplierName = :supplierName"), @NamedQuery(name = "Supplier.findBySupplierPhone", query = "SELECT s FROM Supplier s WHERE s.supplierPhone = :supplierPhone"), @NamedQuery(name = "Supplier.findBySupplierAddress", query = "SELECT s FROM Supplier s WHERE s.supplierAddress = :supplierAddress"), @NamedQuery(name = "Supplier.findBySupplierNote", query = "SELECT s FROM Supplier s WHERE s.supplierNote = :supplierNote")})public class Supplier implements Serializable {    @Id    @Column(name = "supplierName", nullable = false)    private String supplierName;    @Column(name = "supplierPhone")    private String supplierPhone;    @Column(name = "supplierAddress")    private String supplierAddress;    @Column(name = "supplierNote")    private String supplierNote;    @OneToMany(cascade = CascadeType.ALL, mappedBy = "supplierName")    private Collection<Stock> stockCollection;    public Supplier() {    }    public Supplier(String supplierName) {        this.supplierName = supplierName;    }    public String getSupplierName() {        return supplierName;    }    public void setSupplierName(String supplierName) {        this.supplierName = supplierName;    }    public String getSupplierPhone() {        return supplierPhone;    }    public void setSupplierPhone(String supplierPhone) {        this.supplierPhone = supplierPhone;    }    public String getSupplierAddress() {        return supplierAddress;    }    public void setSupplierAddress(String supplierAddress) {        this.supplierAddress = supplierAddress;    }    public String getSupplierNote() {        return supplierNote;    }    public void setSupplierNote(String supplierNote) {        this.supplierNote = supplierNote;    }    public Collection<Stock> getStockCollection() {        return stockCollection;    }    public void setStockCollection(Collection<Stock> stockCollection) {        this.stockCollection = stockCollection;    }    @Override    public int hashCode() {        int hash = 0;        hash += (supplierName != null ? supplierName.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 Supplier)) {            return false;        }        Supplier other = (Supplier) object;        if (this.supplierName != other.supplierName && (this.supplierName == null || !this.supplierName.equals(other.supplierName))) {            return false;        }        return true;    }    @Override    public String toString() {        return "com.studio009.store.entity.Supplier[supplierName=" + supplierName + "]";    }}

⌨️ 快捷键说明

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