📄 employeeejb.java
字号:
package enroll.welfareejb;
import java.util.*;
import javax.ejb.*;
public class EmployeeEJB implements EntityBean
{
//- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
//这是一个基于Entity Bean的Bean Class,这个Entity Bean是基于
//Container-managed Persistence的Entity Bean,用来对EmployeeTBL表进行操作
//- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
public String employee_id;
public String name;
private EntityContext context;
//- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
//定义回调方法(CallBack Methods)
//- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
public void setEntityContext(EntityContext context)
{
this.context = context;
}
public void unsetEntityContext()
{
context = null;
}
public String ejbCreate(String employee_id, String name) throws DuplicateKeyException, CreateException
{
this.employee_id = employee_id;
this.name = name;
return null;
}
public void ejbPostCreate(String employee_id, String name)
{}
public void setName(String name)
{
this.name = name;
}
public String getName()
{
return name;
}
public void ejbLoad()
{}
public void ejbStore()
{}
public void ejbActivate()
{
employee_id = (String)context.getPrimaryKey();
}
public void ejbPassivate()
{
employee_id = null;
name = null;
}
public void ejbRemove()
{}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -