CourseEJB.java
资源名称:某公司的java培训教材 [点击查看]
上传用户:dinglihq
上传日期:2013-02-04
资源大小:99958k
文件大小:2k
源码类别:
Java编程
开发平台:
Java
- package bible.ejb.entity.cmp;
- import java.io.Serializable;
- import java.util.*;
- import javax.ejb.*;
- import javax.naming.InitialContext;
- import javax.naming.NamingException;
- import javax.sql.DataSource;
- abstract public class CourseEJB implements EntityBean
- {
- private EntityContext ctx;
- public void setEntityContext(EntityContext ctx) {
- this.ctx = ctx;
- }
- public void unsetEntityContext() {
- this.ctx = null;
- }
- abstract public Integer getId();
- abstract public void setId(Integer id);
- abstract public String getName();
- abstract public void setName(String name);
- abstract public double getCredits();
- abstract public void setCredits(double credits);
- abstract public void setDepartment(DepartmentLocal dept);
- abstract public DepartmentLocal getDepartment();
- public void ejbActivate() {
- }
- public void ejbPassivate() {
- }
- public void ejbLoad() {
- }
- public void ejbStore() {
- }
- public void ejbRemove()
- throws RemoveException
- {
- }
- public Integer ejbCreate(CourseVO course)
- throws CreateException
- {
- setCourseData(course);
- return null;
- }
- public void ejbPostCreate(CourseVO course)
- {
- }
- public CourseVO getCourseData()
- {
- CourseVO course = new CourseVO(this.getId());
- course.setName(this.getName());
- course.setCredits(this.getCredits());
- return course;
- }
- public void setCourseData(CourseVO course)
- {
- setName(course.getName());
- setCredits(course.getCredits());
- }
- }