KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > opensymphony > workflow > spi > ejb > CurrentStepEJB


1 /*
2  * Copyright (c) 2002-2003 by OpenSymphony
3  * All rights reserved.
4  */

5 package com.opensymphony.workflow.spi.ejb;
6
7 import com.opensymphony.ejb.ExceptionlessEntityAdapter;
8
9 import java.sql.Timestamp JavaDoc;
10
11 import javax.ejb.CreateException JavaDoc;
12
13
14 /**
15  * EJB implementation for current steps.
16  *
17  * @ejb.bean
18  * type="CMP"
19  * view-type="local"
20  * name="CurrentStep"
21  * reentrant="False"
22  * schema="CurrentStep"
23  * primkey-field="id"
24  *
25  * @ejb.pk class="java.lang.Long" extends="java.lang.Object"
26  *
27  * @ejb.persistence table-name="OS_CURRENTSTEP"
28  *
29  * @ejb.home local-extends="javax.ejb.EJBLocalHome"
30  *
31  * @ejb.interface local-extends="javax.ejb.EJBLocalObject,com.opensymphony.workflow.spi.ejb.AbstractLocalStep"
32  *
33  * @ejb.env-entry
34  * name="sequenceName"
35  * type="java.lang.String"
36  * value="WorkflowEntryEJB"
37  *
38  * @ejb.ejb-external-ref
39  * ref-name="ejb/SequenceGenerator"
40  * type="Session"
41  * view-type="remote"
42  * link="SequenceGenerator"
43  * home="com.opensymphony.module.sequence.SequenceGeneratorHome"
44  * business="com.opensymphony.module.sequence.SequenceGenerator"
45  *
46  * @ejb.finder
47  * signature="java.util.Collection findByEntryId(long entryId)"
48  * query="SELECT DISTINCT OBJECT(o) from CurrentStep o where o.entryId = ?1"
49  *
50  * @ejb.permission unchecked="true"
51  * @ejb.transaction type="Supports"
52  *
53  * @author <a HREF="mailto:hani@formicary.net">Hani Suleiman</a>
54  * @author <a HREF="mailto:plightbo@hotmail.com">Pat Lightbody</a>
55  */

56 public abstract class CurrentStepEJB extends ExceptionlessEntityAdapter {
57     //~ Methods ////////////////////////////////////////////////////////////////
58

59     /**
60      * @ejb.interface-method
61      */

62     public abstract void setActionId(int actionId);
63
64     /**
65      * @ejb.interface-method
66      * @ejb.persistence column-name="ACTION_ID"
67      */

68     public abstract int getActionId();
69
70     /**
71      * @ejb.interface-method
72      */

73     public abstract void setCaller(String JavaDoc caller);
74
75     /**
76      * @ejb.interface-method
77      * @ejb.persistence column-name="CALLER"
78      */

79     public abstract String JavaDoc getCaller();
80
81     /**
82      * @ejb.interface-method
83      */

84     public abstract void setDueDate(Timestamp JavaDoc dueDate);
85
86     /**
87      * @ejb.interface-method
88      * @ejb.persistence column-name="DUE_DATE"
89      */

90     public abstract Timestamp JavaDoc getDueDate();
91
92     public abstract void setEntryId(long entryId);
93
94     /**
95      * @ejb.interface-method
96      * @ejb.persistence column-name="ENTRY_ID"
97      */

98     public abstract long getEntryId();
99
100     /**
101      * @ejb.interface-method
102      */

103     public abstract void setFinishDate(Timestamp JavaDoc finishDate);
104
105     /**
106      * @ejb.interface-method
107      * @ejb.persistence column-name="FINISH_DATE"
108      */

109     public abstract Timestamp JavaDoc getFinishDate();
110
111     public abstract void setId(Long JavaDoc id);
112
113     /**
114      * @ejb.pk-field
115      * @ejb.interface-method
116      * @ejb.persistence column-name="ID"
117      */

118     public abstract Long JavaDoc getId();
119
120     public abstract void setOwner(String JavaDoc owner);
121
122     /**
123      * @ejb.interface-method
124      * @ejb.persistence column-name="OWNER"
125      */

126     public abstract String JavaDoc getOwner();
127
128     public abstract void setStartDate(Timestamp JavaDoc startDate);
129
130     /**
131      * @ejb.interface-method
132      * @ejb.persistence column-name="START_DATE"
133      */

134     public abstract Timestamp JavaDoc getStartDate();
135
136     /**
137      * @ejb.interface-method
138      */

139     public abstract void setStatus(String JavaDoc status);
140
141     /**
142      * @ejb.interface-method
143      * @ejb.persistence column-name="STATUS"
144      */

145     public abstract String JavaDoc getStatus();
146
147     public abstract void setStepId(int stepId);
148
149     /**
150      * @ejb.interface-method
151      * @ejb.persistence column-name="STEP_ID"
152      */

153     public abstract int getStepId();
154
155     /**
156      * @ejb.create-method
157      */

158     public Long JavaDoc ejbCreate(long entryId, int stepId, String JavaDoc owner, Timestamp JavaDoc startDate, Timestamp JavaDoc dueDate, String JavaDoc status) throws CreateException JavaDoc {
159         try {
160             Long JavaDoc id = new Long JavaDoc(nextLong());
161             setId(id);
162             setEntryId(entryId);
163             setStepId(stepId);
164             setOwner(owner);
165             setStartDate(startDate);
166             setDueDate(dueDate);
167             setStatus(status);
168
169             return id;
170         } catch (Exception JavaDoc e) {
171             throw new CreateException JavaDoc(e.getMessage());
172         }
173     }
174
175     public void ejbPostCreate(long entryId, int stepId, String JavaDoc owner, Timestamp JavaDoc startDate, Timestamp JavaDoc dueDate, String JavaDoc status) throws CreateException JavaDoc {
176     }
177 }
178
Popular Tags