isami100のSwingin' Seasar日記

2000-01-05 s2study.app.entity

Department.java

package s2study.app.entity;

import java.io.Serializable;

public class Department implements Serializable {

    public static final String TABLE = "DEPT";

    private short deptno;

    private String dname;

    private String loc;

    public Department() {
    }

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

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

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

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

    public java.lang.String getLoc() {
        return this.loc;
    }

    public void setLoc(java.lang.String loc) {
        this.loc = loc;
    }

    public boolean equals(Object other) {
        if (!(other instanceof Department))
            return false;
        Department castOther = (Department) other;
        return this.getDeptno() == castOther.getDeptno();
    }

    public String toString() {
        StringBuffer buf = new StringBuffer();
        buf.append(deptno).append(", ");
        buf.append(dname).append(", ");
        buf.append(loc);
        return buf.toString();
    }

    public int hashCode() {
        return (int) this.getDeptno();
    }
}

Employee.java

package s2study.app.entity;

import java.io.Serializable;

public class Employee implements Serializable {

    public static final String TABLE = "EMP";
    public static final int department_RELNO = 0;

    private long empno;

    private String ename;

    private String job;

    private Short mgr;

    private java.util.Date hiredate;

    private Float sal;

    private Float comm;

    private short deptno;

    private Department department;

    public Employee() {
    }

    public Employee(long empno) {
        this.empno = empno;
    }

    public long getEmpno() {
        return this.empno;
    }

    public void setEmpno(long empno) {
        this.empno = empno;
    }

    public java.lang.String getEname() {
        return this.ename;
    }

    public void setEname(java.lang.String ename) {
        this.ename = ename;
    }

    public java.lang.String getJob() {
        return this.job;
    }

    public void setJob(java.lang.String job) {
        this.job = job;
    }

    public Short getMgr() {
        return this.mgr;
    }

    public void setMgr(Short mgr) {
        this.mgr = mgr;
    }

    public java.util.Date getHiredate() {
        return this.hiredate;
    }

    public void setHiredate(java.util.Date hiredate) {
        this.hiredate = hiredate;
    }

    public Float getSal() {
        return this.sal;
    }

    public void setSal(Float sal) {
        this.sal = sal;
    }

    public Float getComm() {
        return this.comm;
    }

    public void setComm(Float comm) {
        this.comm = comm;
    }

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

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

    public Department getDepartment() {
        return this.department;
    }

    public void setDepartment(Department department) {
        this.department = department;
    }

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

    public String getLoc() {
        return this.department.getLoc();
    }

    public boolean equals(Object other) {
        if (!(other instanceof Employee))
            return false;
        Employee castOther = (Employee) other;
        return this.getEmpno() == castOther.getEmpno();
    }

    public String toString() {
        StringBuffer buf = new StringBuffer();
        buf.append(empno).append(", ");
        buf.append(ename).append(", ");
        buf.append(job).append(", ");
        buf.append(mgr).append(", ");
        buf.append(hiredate).append(", ");
        buf.append(sal).append(", ");
        buf.append(comm).append(", ");
        buf.append(deptno).append(" {");
        buf.append(department).append("}");
        return buf.toString();
    }

    public int hashCode() {
        return (int) this.getEmpno();
    }
}

User.java

package s2study.app.entity;

import java.io.Serializable;

public class User implements Serializable {

    private String _userId;
    private byte[] _passwd;
    private String _userName;

    public User() {
    }
    public User(String _userId, byte[] _passwd, String _userName) {
        this._userId = _userId;
        this._passwd = _passwd;
        this._userName = _userName;
    }

    public String getUserId() {
        return _userId;
    }
    public byte[] getPasswd() {
        return _passwd;
    }
    public String getUserName() {
        return _userName;
    }

    public void setUserId(String _userId) {
        this._userId = _userId;
    }
    public void setPasswd(byte[] _passwd) {
        this._passwd = _passwd;
    }
    public void setUserName(String _userName) {
        this._userName = _userName;
    }

    public boolean equals(Object other) {
        if (!(other instanceof User))
            return false;
        User castOther = (User) other;
        return this.getUserId().equals(castOther.getUserId());
    }

    public int hashCode() {
        return (int) this.getUserId().hashCode();
    }

    public String toString() {
        StringBuffer buf = new StringBuffer();
        buf.append(_userId).append(", ");
        buf.append(_passwd).append(", ");
        buf.append(_userName);
        return buf.toString();
    }

}