KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > cmpdb > testCreateCMPBeansFromDB_OrderTblBean


1 package cmpdb;
2
3 import javax.ejb.*;
4
5 /**
6  * This is the bean class for the OrderTblBean enterprise bean.
7  */

8 public abstract class OrderTblBean implements javax.ejb.EntityBean JavaDoc, cmpdb.OrderTblLocalBusiness {
9     private javax.ejb.EntityContext JavaDoc context;
10     
11     // <editor-fold defaultstate="collapsed" desc="EJB infrastructure methods. Click on the + sign on the left to edit the code.">
12
// TODO Consider creating Transfer Object to encapsulate data
13
// TODO Review finder methods
14
/**
15      * @see javax.ejb.EntityBean#setEntityContext(javax.ejb.EntityContext)
16      */

17     public void setEntityContext(javax.ejb.EntityContext JavaDoc aContext) {
18         context = aContext;
19     }
20     
21     /**
22      * @see javax.ejb.EntityBean#ejbActivate()
23      */

24     public void ejbActivate() {
25         
26     }
27     
28     /**
29      * @see javax.ejb.EntityBean#ejbPassivate()
30      */

31     public void ejbPassivate() {
32         
33     }
34     
35     /**
36      * @see javax.ejb.EntityBean#ejbRemove()
37      */

38     public void ejbRemove() {
39         
40     }
41     
42     /**
43      * @see javax.ejb.EntityBean#unsetEntityContext()
44      */

45     public void unsetEntityContext() {
46         context = null;
47     }
48     
49     /**
50      * @see javax.ejb.EntityBean#ejbLoad()
51      */

52     public void ejbLoad() {
53         
54     }
55     
56     /**
57      * @see javax.ejb.EntityBean#ejbStore()
58      */

59     public void ejbStore() {
60         
61     }
62     // </editor-fold>
63

64     
65     public abstract java.lang.Integer JavaDoc getOrderNum();
66     public abstract void setOrderNum(java.lang.Integer JavaDoc orderNum);
67     
68     public abstract java.lang.Integer JavaDoc getQuantity();
69     public abstract void setQuantity(java.lang.Integer JavaDoc quantity);
70     
71     public abstract java.math.BigDecimal JavaDoc getShippingCost();
72     public abstract void setShippingCost(java.math.BigDecimal JavaDoc shippingCost);
73     
74     public abstract java.sql.Date JavaDoc getSalesDate();
75     public abstract void setSalesDate(java.sql.Date JavaDoc salesDate);
76     
77     public abstract java.sql.Date JavaDoc getShippingDate();
78     public abstract void setShippingDate(java.sql.Date JavaDoc shippingDate);
79     
80     public abstract java.sql.Timestamp JavaDoc getDeliveryDatetime();
81     public abstract void setDeliveryDatetime(java.sql.Timestamp JavaDoc deliveryDatetime);
82     
83     public abstract java.lang.String JavaDoc getFreightCompany();
84     public abstract void setFreightCompany(java.lang.String JavaDoc freightCompany);
85     
86     public abstract cmpdb.CustomerTblLocal getCustomerNum();
87     public abstract void setCustomerNum(cmpdb.CustomerTblLocal customerNum);
88     
89     public abstract cmpdb.ProductTblLocal getProductNum();
90     public abstract void setProductNum(cmpdb.ProductTblLocal productNum);
91     
92     public abstract cmpdb.SalesRepTblLocal getRepNum();
93     public abstract void setRepNum(cmpdb.SalesRepTblLocal repNum);
94     
95     public abstract cmpdb.SalesTaxCodeTblLocal getSalesTaxStCd();
96     public abstract void setSalesTaxStCd(cmpdb.SalesTaxCodeTblLocal salesTaxStCd);
97     
98     
99     public java.lang.Integer JavaDoc ejbCreate(java.lang.Integer JavaDoc orderNum, java.lang.Integer JavaDoc quantity, java.math.BigDecimal JavaDoc shippingCost, java.sql.Date JavaDoc salesDate, java.sql.Date JavaDoc shippingDate, java.sql.Timestamp JavaDoc deliveryDatetime, java.lang.String JavaDoc freightCompany, cmpdb.CustomerTblLocal customerNum, cmpdb.ProductTblLocal productNum, cmpdb.SalesRepTblLocal repNum, cmpdb.SalesTaxCodeTblLocal salesTaxStCd) throws javax.ejb.CreateException JavaDoc {
100         if (orderNum == null) {
101             throw new javax.ejb.CreateException JavaDoc("The field \"orderNum\" must not be null");
102         }
103         if (customerNum == null) {
104             throw new javax.ejb.CreateException JavaDoc("The field \"customerNum\" must not be null");
105         }
106         if (productNum == null) {
107             throw new javax.ejb.CreateException JavaDoc("The field \"productNum\" must not be null");
108         }
109         if (repNum == null) {
110             throw new javax.ejb.CreateException JavaDoc("The field \"repNum\" must not be null");
111         }
112         if (salesTaxStCd == null) {
113             throw new javax.ejb.CreateException JavaDoc("The field \"salesTaxStCd\" must not be null");
114         }
115         
116         // TODO add additional validation code, throw CreateException if data is not valid
117
setOrderNum(orderNum);
118         setQuantity(quantity);
119         setShippingCost(shippingCost);
120         setSalesDate(salesDate);
121         setShippingDate(shippingDate);
122         setDeliveryDatetime(deliveryDatetime);
123         setFreightCompany(freightCompany);
124         
125         return null;
126     }
127     
128     public void ejbPostCreate(java.lang.Integer JavaDoc orderNum, java.lang.Integer JavaDoc quantity, java.math.BigDecimal JavaDoc shippingCost, java.sql.Date JavaDoc salesDate, java.sql.Date JavaDoc shippingDate, java.sql.Timestamp JavaDoc deliveryDatetime, java.lang.String JavaDoc freightCompany, cmpdb.CustomerTblLocal customerNum, cmpdb.ProductTblLocal productNum, cmpdb.SalesRepTblLocal repNum, cmpdb.SalesTaxCodeTblLocal salesTaxStCd) {
129         // TODO populate relationships here if appropriate
130
setCustomerNum(customerNum);
131         setProductNum(productNum);
132         setRepNum(repNum);
133         setSalesTaxStCd(salesTaxStCd);
134         
135     }
136 }
137
Popular Tags