package oracle.byop.maf.data.entities;

import oracle.adfmf.java.beans.PropertyChangeListener;
import oracle.adfmf.java.beans.PropertyChangeSupport;

/**
 *
 * Title:   Bring Your Own Project (BYOP): Hackathon
 * Schema:  ADF Summit
 * Type:    Entity
 *
 * @author Frank Nimphius - August, 2014
 *  */

public class Employee {
    
    private Integer id = null;
    private String lastname = null;
    private String firstname = null;
    private String email = null;
    private Integer deptId = null;
    private Long salary = null;
    private Double commissionPct = null;
    private PropertyChangeSupport propertyChangeSupport = new PropertyChangeSupport(this);

    public Employee() {
        super();
    }
   
   public Employee(Integer id, String lastname, String firstname, String email, Integer deptId, Long salary, Double commssionPct) {
        super();
        this.id = id;
        this.lastname = lastname;
        this.firstname = firstname;
        this.email = email;
        this.deptId = deptId;
        this.salary = salary;
        this.commissionPct = commssionPct;
    }


    public void setId(Integer id) {
        Integer oldId = this.id;
        this.id = id;
        propertyChangeSupport.firePropertyChange("id", oldId, id);
    }

    public Integer getId() {
        return id;
    }

    public void setLastname(String lastname) {
        String oldLastname = this.lastname;
        this.lastname = lastname;
        propertyChangeSupport.firePropertyChange("lastname", oldLastname, lastname);
    }

    public String getLastname() {
        return lastname;
    }

    public void setFirstname(String firstname) {
        String oldFirstname = this.firstname;
        this.firstname = firstname;
        propertyChangeSupport.firePropertyChange("firstname", oldFirstname, firstname);
    }

    public String getFirstname() {
        return firstname;
    }

    public void setEmail(String email) {
        String oldEmail = this.email;
        this.email = email;
        propertyChangeSupport.firePropertyChange("email", oldEmail, email);
    }

    public String getEmail() {
        return email;
    }

    public void setDeptId(Integer deptId) {
        Integer oldDeptId = this.deptId;
        this.deptId = deptId;
        propertyChangeSupport.firePropertyChange("deptId", oldDeptId, deptId);
    }

    public Integer getDeptId() {
        return deptId;
    }

    public void setSalary(Long salary) {
        Long oldSalary = this.salary;
        this.salary = salary;
        propertyChangeSupport.firePropertyChange("salary", oldSalary, salary);
    }

    public Long getSalary() {
        return salary;
    }

    public void setCommissionPct(Double commissionPct) {
        Double oldCommissionPct = this.commissionPct;
        this.commissionPct = commissionPct;
        propertyChangeSupport.firePropertyChange("commissionPct", oldCommissionPct, commissionPct);
    }

    public Double getCommissionPct() {
        return commissionPct;
    }

    public void addPropertyChangeListener(PropertyChangeListener l) {
        propertyChangeSupport.addPropertyChangeListener(l);
    }

    public void removePropertyChangeListener(PropertyChangeListener l) {
        propertyChangeSupport.removePropertyChangeListener(l);
    }
}
