📄 scoreeo.java
字号:
package com.fengmanfei.student.entity;
import java.io.Serializable;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.Transient;
@Entity
@Table(name = "tb_score")
public class ScoreEO implements Serializable {
private static final long serialVersionUID = -40879065272661219L;
@Id
@GeneratedValue(strategy = GenerationType.AUTO)
private int id;
@ManyToOne
@JoinColumn(name = "course_id")
private CourseEO courseEO;
@ManyToOne
@JoinColumn(name = "student_id")
private StudentEO studentEO;
private double score;
@Transient
private String scoreInfo;
public CourseEO getCourseEO() {
return courseEO;
}
public void setCourseEO(CourseEO courseEO) {
this.courseEO = courseEO;
}
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public StudentEO getStudentEO() {
return studentEO;
}
public void setStudentEO(StudentEO studentEO) {
this.studentEO = studentEO;
}
public double getScore() {
return score;
}
public void setScore(double score) {
this.score = score;
}
public String getScoreInfo() {
if (score == 100d)
return "满分";
if (score >= 85d)
return "优秀";
if (score >= 75d)
return "良好";
if (score >= 60d)
return "及格";
return "不及格";
}
public void setScoreInfo(String scoreInfo) {
this.scoreInfo = scoreInfo;
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -