KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > test > ejb > cmr > EmployeeBean


1 /*
2  * $Id: EmployeeBean.java,v 1.4 2004/08/06 12:26:50 pilhuhn Exp $
3  */

4 package test.ejb.cmr;
5
6 import javax.ejb.EntityBean JavaDoc;
7 import javax.ejb.CreateException JavaDoc;
8
9 import test.ejb.cmr.EmployeeAddressLocal;
10 import test.ejb.cmr.EmployeeValue;
11
12 /**
13  * @ejb.bean
14  * name="Employee"
15  * type="CMP"
16  * cmp-version="2.x"
17  * primkey-field="id"
18  * view-type="local"
19  *
20  * @ejb.persistence
21  * table-name="employee"
22  * @ejb.value-object
23  * name="Employee"
24  * match="*"
25  *
26  * @author Marcus Brito
27  * @version $Revision: 1.4 $ $Date: 2004/08/06 12:26:50 $
28  */

29 public abstract class EmployeeBean implements EntityBean JavaDoc
30 {
31     /**
32      * @ejb.interface-method
33      * view-type="local"
34      * @ejb.persistence
35      * column-name="employee_id"
36      */

37     public abstract Integer JavaDoc getId();
38     public abstract void setId(Integer JavaDoc id);
39
40     /**
41      * @ejb.interface-method
42      * view-type="local"
43      * @ejb.persistence
44      * column-name="employee_name"
45      */

46     public abstract String JavaDoc getName();
47
48     /**
49      * @ejb.persistence
50      * view-type="local"
51      */

52     public abstract void setName(String JavaDoc name);
53
54     /**
55      * @ejb.interface-method
56      * view-type="local"
57      * @ejb.relation
58      * name="Employee-HomeAddress"
59      * role-name="employee-has-home-address"
60      * target-ejb="EmployeeAddress"
61      * target-role-name="address-belongs-to-employee"
62      * @weblogic.column-map
63      * foreign-key-column="employee_id"
64      * key-column="employee_id"
65      * @weblogic.target-column-map
66      * foreign-key-column="home_addr_id"
67      * key-column="addr_id"
68      * @ejb.value-object
69      * aggregate="test.ejb.cmr.EmployeeAddressValue"
70      * aggregate-name="HomeAddress"
71      * relation="external"
72      */

73     public abstract EmployeeAddressLocal getHomeAddress();
74
75     /**
76      * @ejb.interface-method
77      * view-type="local
78      */

79     public abstract void setHomeAddress(EmployeeAddressLocal address);
80
81     /**
82      * @ejb.interface-method
83      * view-type="local"
84      * @ejb.relation
85      * name="Employee-WorkAddress"
86      * role-name="employee-has-work-address"
87      * target-ejb="EmployeeAddress"
88      * target-role-name="address-belongs-to-employee"
89      * @weblogic.column-map
90      * foreign-key-column="employee_id"
91      * key-column="employee_id"
92      * @weblogic.target-column-map
93      * foreign-key-column="work_addr_id"
94      * key-column="addr_id"
95      * @ejb.value-object
96      * aggregate="test.ejb.cmr.EmployeeAddressValue"
97      * aggregate-name="WorkAddress"
98      * relation="external"
99      */

100     public abstract EmployeeAddressLocal getWorkAddress();
101
102     /**
103      * @ejb.interface-method
104      * view-type="local
105      */

106     public abstract void setWorkAddress(EmployeeAddressLocal address);
107
108     /**
109      * @ejb.interface-method
110      * view-type="local"
111      */

112     public abstract EmployeeValue getEmployeeValue();
113
114     /**
115      * @ejb.interface-method
116      * view-type="local"
117      */

118     public abstract void setEmployeeValue(EmployeeValue value);
119
120     /**
121      * @ejb:create-method
122      */

123     public Integer JavaDoc ejbCreate(EmployeeValue ev) throws CreateException JavaDoc {
124         setId(ev.getId());
125         return ev.getId();
126     }
127 }
128
Popular Tags