3.TeacherCourse类:
package com.xiyou.dao.po;
import java.io.Serializable;
import javax.persistence.AttributeOverride;
import javax.persistence.AttributeOverrides;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.EmbeddedId;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToOne;
import javax.persistence.Table;
import com.xiyou.dao.po.TeacherCourseId;
@Entity
@Table(name="teacher_course")
public class TeacherCourse implements Serializable{
private String tea_cou_weekdays;
private String tea_cou_period;
private int tea_cou_cplan;
private Teacher tea_cou;
private Courseinfo cou_cou;
private TeacherCourseId id;
public TeacherCourse() {
super();
}
public TeacherCourse(String tea_cou_weekdays, String tea_cou_period,
int tea_cou_cplan, Teacher tea_cou, Courseinfo cou_cou,
TeacherCourseId id) {
super();
this.tea_cou_weekdays = tea_cou_weekdays;
this.tea_cou_period = tea_cou_period;
this.tea_cou_cplan = tea_cou_cplan;
this.tea_cou = tea_cou;
this.cou_cou = cou_cou;
this.id = id;
}
@EmbeddedId
@AttributeOverrides({
@AttributeOverride(name = "tno", column = @Column(name = "tno", nullable = false, length = 20)),
@AttributeOverride(name = "cno", column = @Column(name = "cno", nullable = false, length = 20)) })
public TeacherCourseId getId() {
return id;
}
public void setId(TeacherCourseId id) {
this.id = id;
}
@ManyToOne(fetch=FetchType.EAGER)
@JoinColumn(name = "cno", nullable = false, insertable = false, updatable = false)
public Teacher getTea_cou() {
return tea_cou;
}
public void setTea_cou(Teacher tea_cou) {
this.tea_cou = tea_cou;
}
@ManyToOne(fetch=FetchType.EAGER)
@JoinColumn(name = "tno", nullable = false, insertable = false, updatable = false)
public Courseinfo getCou_cou() {
return cou_cou;
}
public void setCou_cou(Courseinfo cou_cou) {
this.cou_cou = cou_cou;
}
@Column(name="weekday")
public String getTea_cou_weekdays() {
return tea_cou_weekdays;
}
public void setTea_cou_weekdays(String tea_cou_weekdays) {
this.tea_cou_weekdays = tea_cou_weekdays;
}
@Column(name="period")
public String getTea_cou_period() {
return tea_cou_period;
}
public void setTea_cou_period(String tea_cou_period) {
this.tea_cou_period = tea_cou_period;
}
@Column(name="cplan")
public int getTea_cou_cplan() {
return tea_cou_cplan;
}
public void setTea_cou_cplan(int tea_cou_cplan) {
this.tea_cou_cplan = tea_cou_cplan;
}
}