001: package hero.entity;
002:
003: import hero.interfaces.BnAgentEdgePK;
004: import hero.interfaces.BnAgentEdgeValue;
005: import hero.interfaces.BnAgentLocal;
006: import hero.interfaces.BnNodeLocal;
007: import hero.interfaces.BnProjectLocal;
008: import hero.interfaces.InvalidValueException;
009:
010: import java.util.Date;
011:
012: import javax.ejb.CreateException;
013: import javax.ejb.EJBException;
014: import javax.ejb.EntityBean;
015: import javax.ejb.EntityContext;
016: import javax.ejb.RemoveException;
017:
018: /**
019: * The Entity bean represents a BnAgentEdge
020: *
021: * @author Miguel Valdes
022: * @version $Revision: 1.9 $
023: *
024: * @ejb:bean name="BnAgentEdge"
025: * display-name="BnAgentEdge Entity"
026: * type="CMP"
027: * jndi-name="ejb/hero/BnAgentEdge"
028: * local-jndi-name="ejb/hero/BnAgentEdge_L"
029: * view-type="both"
030: * cmp-version="2.x"
031: * reentrant="true"
032: *
033: * @ejb:pk
034: * class="hero.interfaces.BnAgentEdgePK"
035: *
036: * @ejb:transaction type="Supports"
037: *
038: * @jonas.bean
039: * lock-policy="container-read-committed"
040: * @jonas.jdbc-mapping
041: * jndi-name="bonita"
042: * jdbc-table-name="BnAgentEdge"
043: *
044: * @jonas.shared false
045: *
046: * @ejb:finder signature="java.util.Collection findAll()"
047: * query="SELECT object(a) FROM BnAgentEdge a"
048: * transaction-type="Supports"
049: *
050: * @ejb:finder signature="hero.interfaces.BnAgentEdge findByName(java.lang.String pName, java.lang.String projectId )" view-type="both" result-type-mapping="Remote"
051: * query="SELECT OBJECT(a) FROM BnAgentEdge a WHERE a.name = ?1 AND a.bnProject.id = ?2"
052: * transaction-type="Supports"
053: * @ejb:finder signature="hero.interfaces.BnAgentEdgeLocal findByName(java.lang.String pName, java.lang.String projectId )" view-type="both" result-type-mapping="Local"
054: * query="SELECT OBJECT(a) FROM BnAgentEdge a WHERE a.name = ?1 AND a.bnProject.id = ?2"
055: * transaction-type="Supports"
056: * @ejb.value-object
057: * match="*"
058: * name="BnAgentEdge"
059: *
060: * @jboss.persistence
061: * table-name="BnAgentEdge"
062: * create-table="true"
063: * remove-table="false"
064: *
065: * @jboss.container-configuration name="Standard CMP 2.x EntityBean for Bonita"
066: **/
067:
068: public abstract class BnAgentEdgeBean implements EntityBean {
069:
070: // -------------------------------------------------------------------------
071: // Members
072: // -------------------------------------------------------------------------
073:
074: public EntityContext mContext;
075:
076: // -------------------------------------------------------------------------
077: // Properties (Getters/Setters)
078: // -------------------------------------------------------------------------
079:
080: /**
081: * Retrieve the BnAgentEdge's id.
082: *
083: * @return Returns an int representing the id of this BnAgentEdge.
084: *
085: * @ejb:pk-field
086: *
087: * @ejb:persistence column-name="id"
088: * @jonas.cmp-field-jdbc-mapping
089: * field-name="id"
090: * jdbc-field-name="id"
091: * @ejb:transaction type="Supports"
092: **/
093: public abstract String getId();
094:
095: /**
096: * Set the BnAgentEdge's id.
097: *
098: * @param pId The id of this BnAgentEdge. Is set at creation time.
099: * @ejb:transaction type="Required"
100: **/
101: public abstract void setId(String pId);
102:
103: /**
104: * Retrieve the BnAgentEdge's name.
105: *
106: * @return Returns a string representing the name of this BnAgentEdge.
107: *
108: * @ejb:interface-method view-type="both"
109: *
110: * @ejb:persistence column-name="name"
111: * @ejb:transaction type="Supports"
112: **/
113: public abstract String getName();
114:
115: /**
116: * Set the BnAgentEdge's name.
117: *
118: * @param pName The name of this BnAgentEdge. Is set at creation time.
119: * @ejb:transaction type="Required"
120: **/
121: public abstract void setName(String pName);
122:
123: /**
124: * @return the project of the BnAgentEdge
125: * @ejb:interface-method view-type="local"
126: * @ejb:relation name="AgentEdges" role-name="is-edge-of" target-ejb="BnProject" target-role-name="Illness-Has-Patient"
127: * @ejb:transaction type="Supports"
128: *
129: * @jboss.relation
130: * related-pk-field = "id"
131: * fk-column = "projectIdFK"
132: *
133: **/
134: public abstract BnProjectLocal getBnProject();
135:
136: /**
137: * Set the BnProject Name.
138: *
139: * @param pName The Name of this BnAgentEdge. Is set at creation time.
140: * @ejb:interface-method view-type="local"
141: * @ejb:transaction type="Required"
142: **/
143: public abstract void setBnProject(BnProjectLocal pProject);
144:
145: /**
146: * @return the state of the BnAgentEdge
147: * @ejb:interface-method view-type="local"
148: * @ejb:persistence column-name="state"
149: * @ejb:transaction type="Supports"
150: *
151: **/
152: public abstract int getState();
153:
154: /**
155: * Set the State value.
156: *
157: * @param pstate The new state of this BnAgentEdge.
158: * @ejb:interface-method view-type="local"
159: * @ejb:transaction type="Required"
160: **/
161: public abstract void setState(int state);
162:
163: /**
164: * @return the In BnAgent of the BnAgentEdge
165: * @ejb:interface-method view-type="local"
166: * @ejb:relation name="InAgent" role-name="has-node-in" target-ejb="BnAgent"
167: * @ejb:value-object match="*"
168: * relation="external"
169: * aggregate="hero.interfaces.BnAgentLightValue"
170: * aggregate-name="InAgent"
171: * @ejb:transaction type="Supports"
172: *
173: * @jboss.relation
174: * related-pk-field = "id"
175: * fk-column = "agentEdgeIdFK"
176: **/
177: public abstract BnAgentLocal getInBnAgent();
178:
179: /**
180: * Set the BnProject Name.
181: *
182: * @param pAgent The In BnAgent of the BnAgentEdge
183: * @ejb:interface-method view-type="local"
184: * @ejb:transaction type="Required"
185: **/
186: public abstract void setInBnAgent(BnAgentLocal pAgent);
187:
188: /**
189: * @return the Out BnNode of the BnEdge
190: * @ejb:interface-method view-type="local"
191: * @ejb:relation name="OutNodeInAgentEdge" role-name="has-node-out" target-ejb="BnNode"
192: * @ejb:value-object match="*"
193: * relation="external"
194: * aggregate="hero.interfaces.BnNodeLightValue"
195: * aggregate-name="OutNodeInAgentEdge"
196: * @ejb:transaction type="Supports"
197: *
198: * @jboss.relation
199: * related-pk-field = "id"
200: * fk-column = "nodeAgentEdgeIdFK"
201: **/
202: public abstract BnNodeLocal getOutBnNode();
203:
204: /**
205: * Set the BnProject Name.
206: *
207: * @param pNode The Name of this BnEdge. Is set at creation time.
208: * @ejb:interface-method view-type="local"
209: * @ejb:transaction type="Required"
210: **/
211: public abstract void setOutBnNode(BnNodeLocal pNode);
212:
213: /**
214: * @return Return the creation date of the BnAgentEdge
215: * @ejb:interface-method view-type="both"
216: * @ejb:persistence column-name="creationdate"
217: * @ejb:transaction type="Supports"
218: *
219: **/
220:
221: public abstract Date getCreationDate();
222:
223: /**
224: * @param pDate the creation date of the BnAgentEdge
225: * @ejb:interface-method view-type="both"
226: * @ejb:transaction type="Required"
227: *
228: **/
229: public abstract void setCreationDate(Date pDate);
230:
231: /**
232: * @ejb.interface-method
233: * @ejb:transaction type="Supports"
234: */
235: public abstract BnAgentEdgeValue getBnAgentEdgeValue();
236:
237: /**
238: * @ejb.interface-method
239: * @ejb:transaction type="Required"
240: */
241: public abstract void setBnAgentEdgeValue(BnAgentEdgeValue v);
242:
243: // -------------------------------------------------------------------------
244: // Framework Callbacks
245: // -------------------------------------------------------------------------
246:
247: /**
248: * Create a BnAgentEdge based on the supplied BnAgentEdge Value Object.
249: *
250: *
251: * @throws InvalidValueException If one of the values are not correct,
252: * this will not roll back the transaction
253: * because the caller has the chance to
254: * fix the problem and try again
255: * @throws EJBException If no new unique ID could be retrieved this will
256: * rollback the transaction because there is no
257: * hope to try again
258: * @throws CreateException Because we have to do so (EJB spec.)
259: *
260: * @ejb:create-method view-type="both"
261: **/
262: public BnAgentEdgePK ejbCreate() throws InvalidValueException,
263: EJBException, CreateException {
264: this .setName("BnAgentEdge" + this .getId());
265: this .setId(hero.interfaces.BnAgentEdgeUtil.generateGUID(this ));
266: return null;
267: }
268:
269: /**
270: * Create a BnAgentEdge based on the supplied BnAgentEdge Value Object. (c'est merdique)
271: *
272: *
273: * @throws InvalidValueException If one of the values are not correct,
274: * this will not roll back the transaction
275: * because the caller has the chance to
276: * fix the problem and try again
277: * @throws EJBException If no new unique ID could be retrieved this will
278: * rollback the transaction because there is no
279: * hope to try again
280: * @throws CreateException Because we have to do so (EJB spec.)
281: *
282: * @ejb:create-method view-type="both"
283: **/
284: public BnAgentEdgePK ejbCreate(BnAgentEdgeValue pAgentEdge)
285: throws CreateException {
286: return null;
287: }
288:
289: public void ejbPostCreate(BnAgentEdgeValue pAgentEdge) {
290: // Assign value object in ejbPostCreate to apply XDoclet best
291: // practice. If not done, there will be an error in JBoss if
292: // the Value Object has relations.
293: this .setBnAgentEdgeValue(pAgentEdge);
294: }
295:
296: public void ejbPostCreate() {
297: }
298:
299: public void setEntityContext(EntityContext lContext) {
300: mContext = lContext;
301: }
302:
303: public void unsetEntityContext() {
304: mContext = null;
305: }
306:
307: public void ejbActivate() {
308: }
309:
310: public void ejbPassivate() {
311: }
312:
313: public void ejbLoad() {
314: }
315:
316: public void ejbStore() {
317: }
318:
319: public void ejbRemove() throws RemoveException {
320: }
321:
322: }
|