package com.javahonk.bean;

// Generated May 22, 2014 10:03:19 PM by Hibernate Tools 4.0.0

import java.util.HashSet;
import java.util.Set;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.JoinColumn;
import javax.persistence.JoinTable;
import javax.persistence.ManyToMany;

import static javax.persistence.GenerationType.IDENTITY;

import javax.persistence.Id;
import javax.persistence.Table;

/**
 * Employee generated by hbm2java
 */
@Entity
@Table(name = "employee", catalog = "JavaHonk")
public class Employee implements java.io.Serializable {

    private Integer employeeId;
    private String firstName;
    private String lastName;
    private Set<Project> projects = new HashSet<Project>();

    public Employee() {
    }

    public Employee(String firstName, String lastName) {
	this.firstName = firstName;
	this.lastName = lastName;
    }

    @Id
    @GeneratedValue(strategy = IDENTITY)
    @Column(name = "Employee_Id", unique = true, nullable = false)
    public Integer getEmployeeId() {
	return this.employeeId;
    }

    public void setEmployeeId(Integer employeeId) {
	this.employeeId = employeeId;
    }

    @Column(name = "First_Name", length = 50)
    public String getFirstName() {
	return this.firstName;
    }

    public void setFirstName(String firstName) {
	this.firstName = firstName;
    }

    @Column(name = "Last_Name", length = 50)
    public String getLastName() {
	return this.lastName;
    }

    public void setLastName(String lastName) {
	this.lastName = lastName;
    }

    @ManyToMany(cascade = {CascadeType.ALL})
    @JoinTable(name="Employee_Project", 
            joinColumns={@JoinColumn(name="Employee_Id")}, 
            inverseJoinColumns={@JoinColumn(name="Project_Id")})   
    public Set<Project> getProjects() {
        return projects;
    }

    public void setProjects(Set<Project> projects) {
        this.projects = projects;
    }
    
    

}
