accountcategory.java.svn-base

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

SVN-BASE
120
字号
/* * AccountCategory.java *  * Created on 2007-6-1, 14:22:22 *  * @version 1.0 * @ */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.NamedQueries;import javax.persistence.NamedQuery;import javax.persistence.OneToMany;import javax.persistence.Table;/** * 收支种类实体类 * <p> * 该类对应数据库的表, * 数据库每个字段可以找到一个属性. * 详情参加数据库设计书. * </p> * @see Account * @author wangs */@Entity@Table(name = "accountcategory")@NamedQueries( {@NamedQuery(name = "AccountCategory.findByAccountCategoryName", query = "SELECT a FROM AccountCategory a WHERE a.accountCategoryName = :accountCategoryName"), @NamedQuery(name = "AccountCategory.findByAccountCategoryType", query = "SELECT a FROM AccountCategory a WHERE a.accountCategoryType = :accountCategoryType"), @NamedQuery(name = "AccountCategory.findByAccountCategoryNote", query = "SELECT a FROM AccountCategory a WHERE a.accountCategoryNote = :accountCategoryNote")})public class AccountCategory implements Serializable {    @Id    @Column(name = "accountCategoryName", nullable = false)    @GeneratedValue(strategy=GenerationType.IDENTITY)    private String accountCategoryName;    @Column(name = "accountCategoryType", nullable = false)    private String accountCategoryType;    @Column(name = "accountCategoryNote")    private String accountCategoryNote;    @OneToMany(cascade = CascadeType.ALL, mappedBy = "accountCategoryName")    private Collection<Account> accountCollection;    public AccountCategory() {    }    public AccountCategory(String accountCategoryName) {        this.accountCategoryName = accountCategoryName;    }    public AccountCategory(String accountCategoryName, String accountCategoryType) {        this.accountCategoryName = accountCategoryName;        this.accountCategoryType = accountCategoryType;    }    public String getAccountCategoryName() {        return accountCategoryName;    }    public void setAccountCategoryName(String accountCategoryName) {        this.accountCategoryName = accountCategoryName;    }    public String getAccountCategoryType() {        return accountCategoryType;    }    public void setAccountCategoryType(String accountCategoryType) {        this.accountCategoryType = accountCategoryType;    }    public String getAccountCategoryNote() {        return accountCategoryNote;    }    public void setAccountCategoryNote(String accountCategoryNote) {        this.accountCategoryNote = accountCategoryNote;    }    public Collection<Account> getAccountCollection() {        return accountCollection;    }    public void setAccountCollection(Collection<Account> accountCollection) {        this.accountCollection = accountCollection;    }    @Override    public int hashCode() {        int hash = 0;        hash += (accountCategoryName != null ? accountCategoryName.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 AccountCategory)) {            return false;        }        AccountCategory other = (AccountCategory) object;        if (this.accountCategoryName != other.accountCategoryName && (this.accountCategoryName == null || !this.accountCategoryName.equals(other.accountCategoryName))) {            return false;        }        return true;    }    @Override    public String toString() {        return "com.studio009.store.entity.AccountCategory[accountCategoryName=" + accountCategoryName + "]";    }}

⌨️ 快捷键说明

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