📄 courseejb.java
字号:
package day21ex.course;
import javax.ejb.*;
public abstract class CourseEJB implements EntityBean {
protected EntityContext ctx;
public CourseEJB() {
}
public abstract String getCourseId();
public abstract void setCourseId(String courseID);
public abstract String getName();
public abstract void setName(String name);
public abstract double getFee();
public abstract void setFee(double fee);
public void ejbActivate() {
System.out.println("ejbActivate() called.");
}
public void ejbRemove() {
System.out.println("ejbRemove() called.");
}
public void ejbPassivate() {
System.out.println("ejbPassivate () called.");
}
public void ejbLoad() {
System.out.println("ejbLoad() called.");
}
public void ejbStore() {
System.out.println("ejbStore() called.");
}
public void setEntityContext(EntityContext ctx) {
System.out.println("setEntityContext called");
this.ctx = ctx;
}
public void unsetEntityContext() {
System.out.println("unsetEntityContext called");
this.ctx = null;
}
public void ejbPostCreate(String courseID, String name, double fee) {
System.out.println("ejbPostCreate() called");
}
public String ejbCreate(String courseID, String name, double fee)
throws CreateException {
System.out.println("ejbCreate() called");
setCourseId(courseID);
setName(name);
setFee(fee);
return null;
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -