Add POJO class
Code:
package model;
// Generated Feb 15, 2012 11:28:05 PM by Hibernate Tools 3.2.1.GA
import java.io.Serializable;
import java.util.HashSet;
import java.util.Set;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;
/**
* TblEmployee generated by hbm2java
*/
@Entity
@Table(name="tblEmployee"
,schema="dbo"
,catalog="PTS"
)
public class TblEmployee implements java.io.Serializable {
private int id;
private TblDepartment tblDepartment;
private String firstName;
private String lastName;
private String phone;
private String email;
private String password;
private boolean isAdmin;
private Set<TblDepartment> tblDepartments = new HashSet<TblDepartment>(0);
private Set<TblCheckpointResult> tblCheckpointResults = new HashSet<TblCheckpointResult>(0);
private Set<TblCheckpointDetailResult> tblCheckpointDetailResults = new HashSet<TblCheckpointDetailResult>(0);
private Set<TblProjectEmployee> tblProjectEmployees = new HashSet<TblProjectEmployee>(0);
private Set<TblProject> tblProjects = new HashSet<TblProject>(0);
public TblEmployee() {
}
public TblEmployee(int id, TblDepartment tblDepartment, String firstName, String lastName, String phone, String email, String password, boolean isAdmin) {
this.id = id;
this.tblDepartment = tblDepartment;
this.firstName = firstName;
this.lastName = lastName;
this.phone = phone;
this.email = email;
this.password = password;
this.isAdmin = isAdmin;
}
public TblEmployee(int id, TblDepartment tblDepartment, String firstName, String lastName, String phone, String email, String password, boolean isAdmin, Set<TblDepartment> tblDepartments, Set<TblCheckpointResult> tblCheckpointResults, Set<TblCheckpointDetailResult> tblCheckpointDetailResults, Set<TblProjectEmployee> tblProjectEmployees, Set<TblProject> tblProjects) {
this.id = id;
this.tblDepartment = tblDepartment;
this.firstName = firstName;
this.lastName = lastName;
this.phone = phone;
this.email = email;
this.password = password;
this.isAdmin = isAdmin;
this.tblDepartments = tblDepartments;
this.tblCheckpointResults = tblCheckpointResults;
this.tblCheckpointDetailResults = tblCheckpointDetailResults;
this.tblProjectEmployees = tblProjectEmployees;
this.tblProjects = tblProjects;
}
@Id
@Column(name="id", unique=true, nullable=false)
public int getId() {
return this.id;
}
public void setId(int id) {
this.id = id;
}
@ManyToOne(fetch=FetchType.LAZY)
@JoinColumn(name="departmentID", nullable=false)
public TblDepartment getTblDepartment() {
return this.tblDepartment;
}
public void setTblDepartment(TblDepartment tblDepartment) {
this.tblDepartment = tblDepartment;
}
@Column(name="firstName", nullable=false)
public String getFirstName() {
return this.firstName;
}
public void setFirstName(String firstName) {
this.firstName = firstName;
}
@Column(name="lastName", nullable=false)
public String getLastName() {
return this.lastName;
}
public void setLastName(String lastName) {
this.lastName = lastName;
}
@Column(name="phone", nullable=false, length=20)
public String getPhone() {
return this.phone;
}
public void setPhone(String phone) {
this.phone = phone;
}
@Column(name="email", nullable=false, length=50)
public String getEmail() {
return this.email;
}
public void setEmail(String email) {
this.email = email;
}
@Column(name="password", nullable=false)
public String getPassword() {
return this.password;
}
public void setPassword(String password) {
this.password = password;
}
@Column(name="isAdmin", nullable=false)
public boolean isIsAdmin() {
return this.isAdmin;
}
public void setIsAdmin(boolean isAdmin) {
this.isAdmin = isAdmin;
}
@OneToMany(cascade=CascadeType.ALL, fetch=FetchType.LAZY, mappedBy="tblEmployee")
public Set<TblDepartment> getTblDepartments() {
return this.tblDepartments;
}
public void setTblDepartments(Set<TblDepartment> tblDepartments) {
this.tblDepartments = tblDepartments;
}
@OneToMany(cascade=CascadeType.ALL, fetch=FetchType.LAZY, mappedBy="tblEmployee")
public Set<TblCheckpointResult> getTblCheckpointResults() {
return this.tblCheckpointResults;
}
public void setTblCheckpointResults(Set<TblCheckpointResult> tblCheckpointResults) {
this.tblCheckpointResults = tblCheckpointResults;
}
@OneToMany(cascade=CascadeType.ALL, fetch=FetchType.LAZY, mappedBy="tblEmployee")
public Set<TblCheckpointDetailResult> getTblCheckpointDetailResults() {
return this.tblCheckpointDetailResults;
}
public void setTblCheckpointDetailResults(Set<TblCheckpointDetailResult> tblCheckpointDetailResults) {
this.tblCheckpointDetailResults = tblCheckpointDetailResults;
}
@OneToMany(cascade=CascadeType.ALL, fetch=FetchType.LAZY, mappedBy="tblEmployee")
public Set<TblProjectEmployee> getTblProjectEmployees() {
return this.tblProjectEmployees;
}
public void setTblProjectEmployees(Set<TblProjectEmployee> tblProjectEmployees) {
this.tblProjectEmployees = tblProjectEmployees;
}
@OneToMany(cascade=CascadeType.ALL, fetch=FetchType.LAZY, mappedBy="tblEmployee")
public Set<TblProject> getTblProjects() {
return this.tblProjects;
}
public void setTblProjects(Set<TblProject> tblProjects) {
this.tblProjects = tblProjects;
}
}
Code:
package model;
// Generated Feb 15, 2012 11:28:05 PM by Hibernate Tools 3.2.1.GA
import java.util.HashSet;
import java.util.Set;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import org.hibernate.annotations.ForeignKey;
/**
* TblProject generated by hbm2java
*/
@Entity
@Table(name="tblProject"
,schema="dbo"
,catalog="PTS"
)
public class TblProject implements java.io.Serializable {
private int id;
private TblDepartment tblDepartment;
private TblEmployee tblEmployee;
private String name;
private int numberOfEmployee;
private int rank;
private String scope;
private Set<TblCheckpoint> tblCheckpoints = new HashSet<TblCheckpoint>(0);
private Set<TblProjectEmployee> tblProjectEmployees = new HashSet<TblProjectEmployee>(0);
public TblProject() {
}
public TblProject(int id, String name, int numberOfEmployee, int rank, String scope) {
this.id = id;
this.name = name;
this.numberOfEmployee = numberOfEmployee;
this.rank = rank;
this.scope = scope;
}
public TblProject(int id, TblDepartment tblDepartment, TblEmployee tblEmployee, String name, int numberOfEmployee, int rank, String scope, Set<TblCheckpoint> tblCheckpoints, Set<TblProjectEmployee> tblProjectEmployees) {
this.id = id;
this.tblDepartment = tblDepartment;
this.tblEmployee = tblEmployee;
this.name = name;
this.numberOfEmployee = numberOfEmployee;
this.rank = rank;
this.scope = scope;
this.tblCheckpoints = tblCheckpoints;
this.tblProjectEmployees = tblProjectEmployees;
}
@Id
@Column(name="id", unique=true, nullable=false)
public int getId() {
return this.id;
}
public void setId(int id) {
this.id = id;
}
@ManyToOne(fetch=FetchType.LAZY)
@JoinColumn(name="primaryDepartmentID")
public TblDepartment getTblDepartment() {
return this.tblDepartment;
}
public void setTblDepartment(TblDepartment tblDepartment) {
this.tblDepartment = tblDepartment;
}
@ManyToOne(fetch=FetchType.LAZY)
@JoinColumn(name="managerID")
@ForeignKey(name="FK_tblProject_tblEmployee")
public TblEmployee getTblEmployee() {
return this.tblEmployee;
}
public void setTblEmployee(TblEmployee tblEmployee) {
this.tblEmployee = tblEmployee;
}
@Column(name="name", nullable=false, length=25)
public String getName() {
return this.name;
}
public void setName(String name) {
this.name = name;
}
@Column(name="numberOfEmployee", nullable=false)
public int getNumberOfEmployee() {
return this.numberOfEmployee;
}
public void setNumberOfEmployee(int numberOfEmployee) {
this.numberOfEmployee = numberOfEmployee;
}
@Column(name="rank", nullable=false)
public int getRank() {
return this.rank;
}
public void setRank(int rank) {
this.rank = rank;
}
@Column(name="scope", nullable=false)
public String getScope() {
return this.scope;
}
public void setScope(String scope) {
this.scope = scope;
}
@OneToMany(cascade=CascadeType.ALL, fetch=FetchType.LAZY, mappedBy="tblProject")
public Set<TblCheckpoint> getTblCheckpoints() {
return this.tblCheckpoints;
}
public void setTblCheckpoints(Set<TblCheckpoint> tblCheckpoints) {
this.tblCheckpoints = tblCheckpoints;
}
@OneToMany(cascade=CascadeType.ALL, fetch=FetchType.LAZY, mappedBy="tblProject")
public Set<TblProjectEmployee> getTblProjectEmployees() {
return this.tblProjectEmployees;
}
public void setTblProjectEmployees(Set<TblProjectEmployee> tblProjectEmployees) {
this.tblProjectEmployees = tblProjectEmployees;
}
}
Please help T_T. I'm out of mind :(