operator.java.svn-base

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

SVN-BASE
177
字号
/* * Operator.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> * @author wangs */@Entity@Table(name = "operator")@NamedQueries( {@NamedQuery(name = "Operator.findByOperatorName", query = "SELECT o FROM Operator o WHERE o.operatorName = :operatorName"), @NamedQuery(name = "Operator.findByPassword", query = "SELECT o FROM Operator o WHERE o.password = :password"), @NamedQuery(name = "Operator.findByOperatorType", query = "SELECT o FROM Operator o WHERE o.operatorType = :operatorType"), @NamedQuery(name = "Operator.findByOperatorDuty", query = "SELECT o FROM Operator o WHERE o.operatorDuty = :operatorDuty"), @NamedQuery(name = "Operator.findByOperatorPhone", query = "SELECT o FROM Operator o WHERE o.operatorPhone = :operatorPhone"), @NamedQuery(name = "Operator.findByOperatorAddress", query = "SELECT o FROM Operator o WHERE o.operatorAddress = :operatorAddress"), @NamedQuery(name = "Operator.findByOperatorNote", query = "SELECT o FROM Operator o WHERE o.operatorNote = :operatorNote")})public class Operator implements Serializable {    @Id    @Column(name = "operatorName", nullable = false)    private String operatorName;    @Column(name = "password", nullable = false)    private String password;    @Column(name = "operatorType", nullable = false)    private String operatorType;    @Column(name = "operatorDuty")    private String operatorDuty;    @Column(name = "operatorPhone")    private String operatorPhone;    @Column(name = "operatorAddress")    private String operatorAddress;    @Column(name = "operatorNote")    private String operatorNote;    @OneToMany(cascade = CascadeType.ALL, mappedBy = "operatorName")    private Collection<Sale> saleCollection;    @OneToMany(cascade = CascadeType.ALL, mappedBy = "operatorName")    private Collection<Stock> stockCollection;    @OneToMany(cascade = CascadeType.ALL, mappedBy = "operatorName")    private Collection<Account> accountCollection;    public Operator() {    }    public Operator(String operatorName) {        this.operatorName = operatorName;    }    public Operator(String operatorName, String password, String operatorType) {        this.operatorName = operatorName;        this.password = password;        this.operatorType = operatorType;    }    public String getOperatorName() {        return operatorName;    }    public void setOperatorName(String operatorName) {        this.operatorName = operatorName;    }    public String getPassword() {        return password;    }    public void setPassword(String password) {        this.password = password;    }    public String getOperatorType() {        return operatorType;    }    public void setOperatorType(String operatorType) {        this.operatorType = operatorType;    }    public String getOperatorDuty() {        return operatorDuty;    }    public void setOperatorDuty(String operatorDuty) {        this.operatorDuty = operatorDuty;    }    public String getOperatorPhone() {        return operatorPhone;    }    public void setOperatorPhone(String operatorPhone) {        this.operatorPhone = operatorPhone;    }    public String getOperatorAddress() {        return operatorAddress;    }    public void setOperatorAddress(String operatorAddress) {        this.operatorAddress = operatorAddress;    }    public String getOperatorNote() {        return operatorNote;    }    public void setOperatorNote(String operatorNote) {        this.operatorNote = operatorNote;    }    public Collection<Sale> getSaleCollection() {        return saleCollection;    }    public void setSaleCollection(Collection<Sale> saleCollection) {        this.saleCollection = saleCollection;    }    public Collection<Stock> getStockCollection() {        return stockCollection;    }    public void setStockCollection(Collection<Stock> stockCollection) {        this.stockCollection = stockCollection;    }    public Collection<Account> getAccountCollection() {        return accountCollection;    }    public void setAccountCollection(Collection<Account> accountCollection) {        this.accountCollection = accountCollection;    }    @Override    public int hashCode() {        int hash = 0;        hash += (operatorName != null ? operatorName.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 Operator)) {            return false;        }        Operator other = (Operator) object;        if (this.operatorName != other.operatorName && (this.operatorName == null || !this.operatorName.equals(other.operatorName))) {            return false;        }        return true;    }    @Override    public String toString() {        return "com.studio009.store.entity.Operator[operatorName=" + operatorName + "]";    }}

⌨️ 快捷键说明

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