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