OrderLineItemEJB.java
资源名称:某公司的java培训教材 [点击查看]
上传用户:dinglihq
上传日期:2013-02-04
资源大小:99958k
文件大小:2k
源码类别:
Java编程
开发平台:
Java
- package day21ex.orderlineitem;
- import javax.naming.*;
- import javax.ejb.*;
- import java.util.*;
- import day21ex.order.*;
- import day21ex.course.*;
- public abstract class OrderLineItemEJB implements EntityBean {
- protected EntityContext ctx;
- public OrderLineItemEJB() {
- System.out.println("OrderLineItem created.");
- }
- public abstract String getOrderLineItemId();
- public abstract void setOrderLineItemId(String id);
- public abstract OrderLocal getOrder();
- public abstract void setOrder(OrderLocal order);
- public abstract CourseLocal getCourse();
- public abstract void setCourse(CourseLocal course);
- public abstract double getFee();
- public abstract void setFee(double fee);
- public void setEntityContext(EntityContext ctx) {
- System.out.println("OrderLineItem.setEntityContext called");
- this.ctx = ctx;
- }
- public void unsetEntityContext() {
- System.out.println("OrderLineItem.unsetEntityContext called");
- this.ctx = null;
- }
- public void ejbActivate() {
- System.out.println("OrderLineItem.ejbActivate() called.");
- }
- public void ejbPassivate() {
- System.out.println("OrderLineItem.ejbPassivate () called.");
- }
- public void ejbStore() {
- System.out.println("OrderLineItem.ejbStore() called.");
- }
- public void ejbLoad() {
- System.out.println("OrderLineItem.ejbLoad() called.");
- }
- public String ejbCreate(String orderLineItemID, OrderLocal order,
- CourseLocal course, double fee) throws CreateException {
- System.out.println("OrderLineItem.ejbCreate(" + orderLineItemID
- + ") called.");
- setOrderLineItemId(orderLineItemID);
- setFee(fee);
- return null;
- }
- public void ejbPostCreate(String orderLineItemID, OrderLocal order,
- CourseLocal course, double fee) throws CreateException {
- System.out.println("OrderLineItem.ejbPostCreate() called");
- setCourse(course);
- setOrder(order);
- }
- public void ejbRemove() {
- System.out.println("OrderLineItem.ejbRemove() called.");
- }
- }