DepartmentViewModel.java
package edu.rit.coopeval.viewmodel.college;
import edu.rit.coopeval.model.College;
import edu.rit.coopeval.model.Department;
import edu.rit.coopeval.model.DepartmentTermForm;
import java.sql.Timestamp;
/**
* Created by anusharma on 4/3/15.
*/
public class DepartmentViewModel {
private long departmentId;
private String departmentCode;
private String currentStudentFormName;
private String currentEmployerFormName;
private String departmentName;
private Timestamp createDate;
private String createBy;
private Timestamp modDate;
private String modBy;
private College collegeByCollegeId;
public DepartmentViewModel(){
}
public DepartmentViewModel(Department dept){
this.departmentId = dept.getDepartmentId();
this.departmentCode = dept.getDepartmentCode();
this.departmentName = dept.getDepartmentName();
this.collegeByCollegeId = dept.getCollegeByCollegeId();
this.currentStudentFormName = null;
this.currentEmployerFormName = null;
for(DepartmentTermForm departmentTermForm: dept.getDepartmentTermFormsByDepartmentId()){
if(departmentTermForm.getTermByTermId().getIsCurrentTerm().equals("1")){
this.currentStudentFormName = departmentTermForm.getFormByStudentFormId().getName();
this.currentEmployerFormName = departmentTermForm.getFormByEmployerFormId().getName();
}
}
}
public long getDepartmentId() {
return departmentId;
}
public void setDepartmentId(long departmentId) {
this.departmentId = departmentId;
}
public String getDepartmentCode() {
return departmentCode;
}
public void setDepartmentCode(String departmentCode) {
this.departmentCode = departmentCode;
}
public String getDepartmentName() {
return departmentName;
}
public void setDepartmentName(String departmentName) {
this.departmentName = departmentName;
}
public Timestamp getCreateDate() {
return createDate;
}
public void setCreateDate(Timestamp createDate) {
this.createDate = createDate;
}
public String getCreateBy() {
return createBy;
}
public void setCreateBy(String createBy) {
this.createBy = createBy;
}
public Timestamp getModDate() {
return modDate;
}
public void setModDate(Timestamp modDate) {
this.modDate = modDate;
}
public String getModBy() {
return modBy;
}
public void setModBy(String modBy) {
this.modBy = modBy;
}
public College getCollegeByCollegeId() {
return collegeByCollegeId;
}
public void setCollegeByCollegeId(College collegeByCollegeId) {
this.collegeByCollegeId = collegeByCollegeId;
}
public String getCurrentStudentFormName() {
return currentStudentFormName;
}
public void setCurrentStudentFormName(String currentStudentFormName) {
this.currentStudentFormName = currentStudentFormName;
}
public String getCurrentEmployerFormName() {
return currentEmployerFormName;
}
public void setCurrentEmployerFormName(String currentEmployerFormName) {
this.currentEmployerFormName = currentEmployerFormName;
}
}