dept.java

来自「采用hibernate2.x框架,数据库采用sqlserver2000,封装了h」· Java 代码 · 共 89 行

JAVA
89
字号
package com;

import java.io.Serializable;
import java.util.Set;
import org.apache.commons.lang.builder.EqualsBuilder;
import org.apache.commons.lang.builder.HashCodeBuilder;
import org.apache.commons.lang.builder.ToStringBuilder;

/** @author Hibernate CodeGenerator */
public class Dept implements Serializable {

    /** identifier field */
    private Integer deptno;

    /** persistent field */
    private String dname;

    /** persistent field */
    private String address;

    /** persistent field */
    private Set emps;

    /** full constructor */
    public Dept(Integer deptno, String dname, String address, Set emps) {
        this.deptno = deptno;
        this.dname = dname;
        this.address = address;
        this.emps = emps;
    }

    /** default constructor */
    public Dept() {
    }

    public Integer getDeptno() {
        return this.deptno;
    }

    public void setDeptno(Integer deptno) {
        this.deptno = deptno;
    }

    public String getDname() {
        return this.dname;
    }

    public void setDname(String dname) {
        this.dname = dname;
    }

    public String getAddress() {
        return this.address;
    }

    public void setAddress(String address) {
        this.address = address;
    }

    public Set getEmps() {
        return this.emps;
    }

    public void setEmps(Set emps) {
        this.emps = emps;
    }

    public String toString() {
        return new ToStringBuilder(this)
            .append("deptno", getDeptno())
            .toString();
    }

    public boolean equals(Object other) {
        if ( !(other instanceof Dept) ) return false;
        Dept castOther = (Dept) other;
        return new EqualsBuilder()
            .append(this.getDeptno(), castOther.getDeptno())
            .isEquals();
    }

    public int hashCode() {
        return new HashCodeBuilder()
            .append(getDeptno())
            .toHashCode();
    }

}

⌨️ 快捷键说明

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