org.openurp.base.hr.model.Teacher Maven / Gradle / Ivy
/*
* OpenURP, Agile University Resource Planning Solution.
*
* Copyright © 2014, The OpenURP Software.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful.
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see .
*/
package org.openurp.base.hr.model;
import org.beangle.commons.entity.pojo.LongIdObject;
import org.hibernate.annotations.Cache;
import org.hibernate.annotations.CacheConcurrencyStrategy;
import org.openurp.base.edu.model.Project;
import org.openurp.base.model.Department;
import javax.persistence.*;
import javax.validation.constraints.NotNull;
import java.util.HashSet;
import java.util.Set;
/**
* 教师信息默认实现
*/
@Entity(name = "org.openurp.base.hr.model.Teacher")
@Cacheable
@Cache(region = "openurp.base", usage = CacheConcurrencyStrategy.NONSTRICT_READ_WRITE)
public class Teacher extends LongIdObject {
private static final long serialVersionUID = 1L;
/**
* 教职工
*/
@NotNull
@ManyToOne(fetch = FetchType.LAZY)
private Staff staff;
@ManyToMany
@Cache(usage = CacheConcurrencyStrategy.NONSTRICT_READ_WRITE, region = "openurp.base")
private Set projects = new HashSet();
private String name;
/**
* 任教院系
*/
@ManyToOne(fetch = FetchType.LAZY)
private Department department;
/**
* 任职开始日期
*/
@NotNull
private java.sql.Date beginOn;
/**
* 任职结束日期
*/
private java.sql.Date endOn;
public String getCode() {
return (null == staff) ? null : staff.getCode();
}
public Staff getStaff() {
return staff;
}
public void setStaff(Staff staff) {
this.staff = staff;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public Department getDepartment() {
return department;
}
public Teacher() {
}
public Teacher(Long id) {
this.setId(id);
}
public java.sql.Date getBeginOn() {
return beginOn;
}
public void setBeginOn(java.sql.Date beginOn) {
this.beginOn = beginOn;
}
public java.sql.Date getEndOn() {
return endOn;
}
public void setEndOn(java.sql.Date endOn) {
this.endOn = endOn;
}
public Set getProjects() {
return projects;
}
public void setProjects(Set projects) {
this.projects = projects;
}
public void setDepartment(Department department) {
this.department = department;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy