package examples.hibernate.entity;

import java.io.Serializable;
import java.math.BigDecimal;

public class Employee implements Serializable {

//    private long empno;
    private Integer empno;
    
    private String ename;

    private String job;

    private Short mgr;

    private java.util.Date hiredate;

    private BigDecimal sal;

    private Float comm;

    private int deptno;

    public Employee(Integer empno, java.lang.String ename, java.lang.String job, Short mgr, java.util.Date hiredate, BigDecimal sal, Float comm, int deptno) {
        this.empno = empno;
        this.ename = ename;
        this.job = job;
        this.mgr = mgr;
        this.hiredate = hiredate;
        this.sal = sal;
        this.comm = comm;
        this.deptno = deptno;
    }

    public Employee() {
    }

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

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

    public void setEmpno(Integer 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 BigDecimal getSal() {
        return this.sal;
    }

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

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

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

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

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

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

    public int hashCode() {
        return this.getEmpno().intValue();
    }
    public String toString() {
    	StringBuffer buf = new StringBuffer();
    	buf.append("[");
    	buf.append(deptno).append(", ");
    	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("]\n");
    	
    	return buf.toString();
    }
}
