001: /*
002: * Copyright (c) 2002-2003 by OpenSymphony
003: * All rights reserved.
004: */
005: package com.opensymphony.workflow.spi.ejb;
006:
007: import com.opensymphony.ejb.ExceptionlessEntityAdapter;
008:
009: import java.sql.Timestamp;
010:
011: import javax.ejb.CreateException;
012:
013: /**
014: * EJB implementation for current steps.
015: *
016: * @ejb.bean
017: * type="CMP"
018: * view-type="local"
019: * name="CurrentStep"
020: * reentrant="False"
021: * schema="CurrentStep"
022: * primkey-field="id"
023: *
024: * @ejb.pk class="java.lang.Long" extends="java.lang.Object"
025: *
026: * @ejb.persistence table-name="OS_CURRENTSTEP"
027: *
028: * @ejb.home local-extends="javax.ejb.EJBLocalHome"
029: *
030: * @ejb.interface local-extends="javax.ejb.EJBLocalObject,com.opensymphony.workflow.spi.ejb.AbstractLocalStep"
031: *
032: * @ejb.env-entry
033: * name="sequenceName"
034: * type="java.lang.String"
035: * value="WorkflowEntryEJB"
036: *
037: * @ejb.ejb-external-ref
038: * ref-name="ejb/SequenceGenerator"
039: * type="Session"
040: * view-type="remote"
041: * link="SequenceGenerator"
042: * home="com.opensymphony.module.sequence.SequenceGeneratorHome"
043: * business="com.opensymphony.module.sequence.SequenceGenerator"
044: *
045: * @ejb.finder
046: * signature="java.util.Collection findByEntryId(long entryId)"
047: * query="SELECT DISTINCT OBJECT(o) from CurrentStep o where o.entryId = ?1"
048: *
049: * @ejb.permission unchecked="true"
050: * @ejb.transaction type="Supports"
051: *
052: * @author <a href="mailto:hani@formicary.net">Hani Suleiman</a>
053: * @author <a href="mailto:plightbo@hotmail.com">Pat Lightbody</a>
054: */
055: public abstract class CurrentStepEJB extends ExceptionlessEntityAdapter {
056: //~ Methods ////////////////////////////////////////////////////////////////
057:
058: /**
059: * @ejb.interface-method
060: */
061: public abstract void setActionId(int actionId);
062:
063: /**
064: * @ejb.interface-method
065: * @ejb.persistence column-name="ACTION_ID"
066: */
067: public abstract int getActionId();
068:
069: /**
070: * @ejb.interface-method
071: */
072: public abstract void setCaller(String caller);
073:
074: /**
075: * @ejb.interface-method
076: * @ejb.persistence column-name="CALLER"
077: */
078: public abstract String getCaller();
079:
080: /**
081: * @ejb.interface-method
082: */
083: public abstract void setDueDate(Timestamp dueDate);
084:
085: /**
086: * @ejb.interface-method
087: * @ejb.persistence column-name="DUE_DATE"
088: */
089: public abstract Timestamp getDueDate();
090:
091: public abstract void setEntryId(long entryId);
092:
093: /**
094: * @ejb.interface-method
095: * @ejb.persistence column-name="ENTRY_ID"
096: */
097: public abstract long getEntryId();
098:
099: /**
100: * @ejb.interface-method
101: */
102: public abstract void setFinishDate(Timestamp finishDate);
103:
104: /**
105: * @ejb.interface-method
106: * @ejb.persistence column-name="FINISH_DATE"
107: */
108: public abstract Timestamp getFinishDate();
109:
110: public abstract void setId(Long id);
111:
112: /**
113: * @ejb.pk-field
114: * @ejb.interface-method
115: * @ejb.persistence column-name="ID"
116: */
117: public abstract Long getId();
118:
119: public abstract void setOwner(String owner);
120:
121: /**
122: * @ejb.interface-method
123: * @ejb.persistence column-name="OWNER"
124: */
125: public abstract String getOwner();
126:
127: public abstract void setStartDate(Timestamp startDate);
128:
129: /**
130: * @ejb.interface-method
131: * @ejb.persistence column-name="START_DATE"
132: */
133: public abstract Timestamp getStartDate();
134:
135: /**
136: * @ejb.interface-method
137: */
138: public abstract void setStatus(String status);
139:
140: /**
141: * @ejb.interface-method
142: * @ejb.persistence column-name="STATUS"
143: */
144: public abstract String getStatus();
145:
146: public abstract void setStepId(int stepId);
147:
148: /**
149: * @ejb.interface-method
150: * @ejb.persistence column-name="STEP_ID"
151: */
152: public abstract int getStepId();
153:
154: /**
155: * @ejb.create-method
156: */
157: public Long ejbCreate(long entryId, int stepId, String owner,
158: Timestamp startDate, Timestamp dueDate, String status)
159: throws CreateException {
160: try {
161: Long id = new Long(nextLong());
162: setId(id);
163: setEntryId(entryId);
164: setStepId(stepId);
165: setOwner(owner);
166: setStartDate(startDate);
167: setDueDate(dueDate);
168: setStatus(status);
169:
170: return id;
171: } catch (Exception e) {
172: throw new CreateException(e.getMessage());
173: }
174: }
175:
176: public void ejbPostCreate(long entryId, int stepId, String owner,
177: Timestamp startDate, Timestamp dueDate, String status)
178: throws CreateException {
179: }
180: }
|