[Join-cvs] join/src/main/org/figure8/join/businessobjects/resource/ejb ISTypeBean.java,NONE,1.1 ISUp
Brought to you by:
lbroudoux
Update of /cvsroot/join/join/src/main/org/figure8/join/businessobjects/resource/ejb
In directory sc8-pr-cvs1:/tmp/cvs-serv3765
Added Files:
ISTypeBean.java ISUpdateBean.java ISVersionBean.java
ISystemBean.java
Log Message:
Initial checkin
--- NEW FILE: ISTypeBean.java ---
/*
* ISTypeBean.java
*
* Created on 8 october 2002, 18:08
*/
package org.figure8.join.businessobjects.resource.ejb;
import org.figure8.join.businessobjects.resource.interfaces.ISTypeData;
import java.util.Set;
/**
* This is the representation of an Information System type.
* @author <a href="mailto:lau...@fr...">Laurent Broudoux</a>
*
* @ejb.bean name="ISType"
type="CMP" cmp-version="2.x" view-type="local"
jndi-name="${objects.res.isType.jndi-name}"
local-jndi-name="${objects.res.isType.jndi-name}Local"
primkey-field="id"
* @ejb.home local-class="org.figure8.join.businessobjects.resource.interfaces.ISTypeLocalHome"
* @ejb.interface local-class="org.figure8.join.businessobjects.resource.interfaces.ISTypeLocal"
* @ejb.data-object package="org.figure8.join.businessobjects.resource.interfaces"
*
* @ejb.finder signature="Collection findAll()" unchecked="true" transaction-type="NotSupported"
*
* @ejb.pk class="java.lang.String" generate="false" unchecked="true"
* @ejb.persistence table-name="${objects.res.isType.table-name}"
*
* @jboss.tuned-updates "true"
* @jboss.read-ahead strategy="on-find"
*/
public abstract class ISTypeBean implements javax.ejb.EntityBean{
// Public -------------------------------------------------------------------
/**
* Information System Type id
* @ejb.pk-field
* @ejb.persistence column-name="s_id"
*/
public abstract String getId();
/** Information System Type id */
public abstract void setId(String id);
/**
* Information System Type label
* @ejb.interface-method
* @ejb.persistence column-name="s_label"
*/
public abstract String getLabel();
/**
* Information System Type label
* @ejb.interface-method
*/
public abstract void setLabel(String label);
/**
* Information Systems of this type
* @ejb.interface-method view-type="local"
* @ejb.relation name="ISType-OneToMany-ISs-Bi"
* role-name="ISType-has-ISs"
*/
public abstract Set getISystems();
/**
* Information Systems of this type
* @ejb.interface-method view-type="local"
*/
public abstract void setISystems(Set iSystems);
/**
* Generated bulk accessor
* @ejb.interface-method
*/
public abstract ISTypeData getData();
/** Generated bulk accessor */
public abstract void setData(ISTypeData data);
// Implementation of EntityBean ---------------------------------------------
/**
* Create a new Information System Type
* @ejb.create-method
*/
public String ejbCreate(ISTypeData data) throws javax.ejb.CreateException{
if (data.getId() != null){
setId(data.getId());
setData(data);
}
else throw new javax.ejb.CreateException("Identifier (id) for ISType must be non null.");
return null;
}
/** Create a new Information System Type */
public void ejbPostCreate(ISTypeData data) throws javax.ejb.CreateException {}
/**
* Remove this Information System Type
* @ejb.transaction type="Mandatory"
*/
public void ejbRemove() throws javax.ejb.RemoveException, javax.ejb.EJBException {}
}
--- NEW FILE: ISUpdateBean.java ---
/*
* ISUpdateBean.java
*
* Created on 24 january 2003, 18:58
*/
package org.figure8.join.businessobjects.resource.ejb;
import org.figure8.join.businessobjects.resource.util.ISUpdateUtil;
import org.figure8.join.businessobjects.resource.interfaces.ISystemLocal;
import org.figure8.join.businessobjects.resource.interfaces.ISVersionLocal;
import org.figure8.join.businessobjects.resource.interfaces.ISUpdateData;
import java.sql.Date;
/**
* This is a representation of an ISystem Update. A ISystem can have many updates
* during time so keep history information for updates. This means that last update,
* with current version on ISystem is the one with <b>enddate == NULL</b>.
* @author <a href="mailto:lau...@fr...">Laurent Broudoux</a>
*
* @ejb.bean name="ISUpdate"
type="CMP" cmp-version="2.x" view-type="local"
jndi-name="${objects.res.isUpdate.jndi-name}"
local-jndi-name="${objects.res.isUpdate.jndi-name}Local"
primkey-field="id"
* @ejb.home local-class="org.figure8.join.businessobjects.resource.interfaces.ISUpdateLocalHome"
* @ejb.interface local-class="org.figure8.join.businessobjects.resource.interfaces.ISUpdateLocal"
* @ejb.data-object package="org.figure8.join.businessobjects.resource.interfaces"
*
* @ejb.finder signature="Collection findActivesForISystem(org.figure8.join.businessobjects.resource.interfaces.ISystemLocal sys)"
unchecked="true" transaction-type="Supports"
query="SELECT DISTINCT OBJECT(iu) FROM ISUpdate AS iu WHERE iu.iSystem=?1 AND iu.endDate IS NULL"
* @ejb.finder signature="Collection findActivesForISystemAndDate(org.figure8.join.businessobjects.resource.interfaces.ISystemLocal sys,
java.util.Date date)"
unchecked="true" transaction-type="Supports"
query="SELECT DISTINCT OBJECT(iu) FROM ISUpdate AS iu WHERE iu.iSystem=?1 AND (iu.startDate<?2 OR iu.startDate=?2) AND (iu.endDate>?2 OR iu.endDate=?2)"
*
* @ejb.pk class="java.lang.String" generate="false" unchecked="true"
* @ejb.persistence table-name="${objects.res.isUpdate.table-name}"
*
* @jboss.tuned-updates "true"
* @jboss.read-ahead strategy="on-find"
*/
public abstract class ISUpdateBean implements javax.ejb.EntityBean{
// Public -------------------------------------------------------------------
/**
* Resource Update id
* @ejb.pk-field
* @ejb.persistence column-name="s_id"
*/
public abstract String getId();
/** Resource Update id */
public abstract void setId(String id);
/**
* Resource Update end date
* @ejb.interface-method
* @ejb.persistence column-name="d_end"
* sql-type="TIMESTAMP"
*/
public abstract java.sql.Date getEndDate();
/**
* Resource Update end date
* @ejb.interface-method
*/
public abstract void setEndDate(java.sql.Date endDate);
/**
* Resource Update start date
* @ejb.interface-method
* @ejb.persistence column-name="d_start"
* sql-type="TIMESTAMP"
*/
public abstract java.sql.Date getStartDate();
/**
* Resource Update start date
* @ejb.interface-method
*/
public abstract void setStartDate(java.sql.Date startDate);
/**
* ISystem concerned by this update
* @ejb.interface-method view-type="local"
* @ejb.relation name="IS-OneToMany-ISUpdates-Uni"
* role-name="ISUpdate-belongsto-IS"
* target-role-name="IS-has-ISUpdates"
* target-ejb="ISystem"
* target-multiple="yes"
* @jboss.relation fk-constraint="true"
* related-pk-field="id"
* fk-column="s_is_fk"
*/
public abstract ISystemLocal getISystem();
/**
* ISystem concerned by this update
* @ejb.interface-method view-type="local"
*/
public abstract void setISystem(ISystemLocal isystem);
/**
* Version used for this update
* @ejb.interface-method view-type="local"
* @ejb.relation name="ISVersion-OneToMany-ISUpdates-Bi"
* role-name="ISUpdate-belongsto-ISVersioin"
* cascade-delete="yes"
* @jboss.relation fk-constraint="true"
* related-pk-field="id"
* fk-column="s_version_fk"
*/
public abstract ISVersionLocal getISVersion();
/**
* Version used for this update
* @ejb.interface-method view-type="local"
*/
public abstract void setISVersion(ISVersionLocal version);
/**
* Generated bulk accessor
* @ejb.interface-method
*/
public abstract ISUpdateData getData();
/** Generated bulk accessor */
public abstract void setData(ISUpdateData data);
/**
* Make this update of IS with version end (because of a new update).
* @ejb.interface-method
*/
public void close(){
setEndDate(new java.sql.Date(System.currentTimeMillis()));
}
// Implementation of EntityBean ---------------------------------------------
/**
* Create a new ISystem Update
* @ejb.create-method
*/
public String ejbCreate(ISUpdateData data, ISystemLocal isystem, ISVersionLocal version) throws javax.ejb.CreateException{
if (data != null){
setId(ISUpdateUtil.generateGUID(this));
setData(data);
}
else throw new javax.ejb.CreateException("Data object for ISpdate must be non null.");
return null;
}
/** Create a new ISystem Update */
public void ejbPostCreate(ISUpdateData data, ISystemLocal isystem, ISVersionLocal version) throws javax.ejb.CreateException{
setISystem(isystem);
setISVersion(version);
}
/**
* Remove this ISystem Update
* @ejb.transaction type="Mandatory"
*/
public void ejbRemove() throws javax.ejb.RemoveException, javax.ejb.EJBException {}
}
--- NEW FILE: ISVersionBean.java ---
/*
* ISVersionBean.java
*
* Created on 9 january 2003, 18:51
*/
package org.figure8.join.businessobjects.resource.ejb;
import org.figure8.join.businessobjects.resource.util.ISVersionUtil;
import org.figure8.join.businessobjects.resource.interfaces.ISTypeLocal;
import org.figure8.join.businessobjects.resource.interfaces.ISVersionData;
import java.sql.Date;
import java.util.Set;
/**
* This is the representation of an Information System Version.
* @author <a href="mailto:lau...@fr...">Laurent Broudoux</a>
*
* @ejb.bean name="ISVersion"
type="CMP" cmp-version="2.x" view-type="local"
jndi-name="${objects.res.isVersion.jndi-name}"
local-jndi-name="${objects.res.isVersion.jndi-name}Local"
primkey-field="id"
* @ejb.home local-class="org.figure8.join.businessobjects.resource.interfaces.ISVersionLocalHome"
* @ejb.interface local-class="org.figure8.join.businessobjects.resource.interfaces.ISVersionLocal"
* @ejb.data-object package="org.figure8.join.businessobjects.resource.interfaces"
*
* @ejb.finder signature="Collection findAll()" unchecked="true" transaction-type="NotSupported"
* @ejb.finder signature="Collection findByType(org.figure8.join.businessobjects.resource.interfaces.ISTypeLocal type)"
unchecked="true" transaction-type="Supports"
query="SELECT DISTINCT OBJECT(iv) FROM ISVersion AS iv WHERE iv.iSType=?1"
*
* @ejb.pk class="java.lang.String" generate="false" unchecked="true"
* @ejb.persistence table-name="${objects.res.isVersion.table-name}"
*
* @jboss.tuned-updates "true"
* @jboss.read-ahead strategy="on-load"
page-size="10"
*
* @jboss.query signature="Collection findByType(org.figure8.join.businessobjects.resource.interfaces.ISTypeLocal type)"
query="SELECT DISTINCT OBJECT(iv) FROM ISVersion AS iv WHERE iv.iSType=?1 ORDER BY iv.creationDate DESC"
strategy="on-find"
*/
public abstract class ISVersionBean implements javax.ejb.EntityBean{
// Public -------------------------------------------------------------------
/**
* Information System Version id
* @ejb.pk-field
* @ejb.persistence column-name="s_id"
*/
public abstract String getId();
/** Information System Version id */
public abstract void setId(String id);
/**
* Information System Version label
* @ejb.interface-method
* @ejb.persistence column-name="s_label"
*/
public abstract String getLabel();
/**
* Information System Version label
* @ejb.interface-method
*/
public abstract void setLabel(String label);
/**
* Information System Version creation date
* @ejb.interface-method
* @ejb.persistence column-name="d_creation"
*/
public abstract java.sql.Date getCreationDate();
/**
* Information System Version creation date
* @ejb.interface-method
*/
public abstract void setCreationDate(java.sql.Date creationDate);
/**
* Information System Version comments
* @ejb.interface-method
* @ejb.persistence column-name="s_comments"
*/
public abstract String getComments();
/**
* Information System Version comments
* @ejb.interface-method
*/
public abstract void setComments(String comments);
/**
* Type of this Information System Version
* @ejb.interface-method view-type="local"
* @ejb.relation name="ISType-OneToMany-ISVersions-Uni"
* role-name="ISVersion-belongsto-ISType"
* target-role-name="ISType-has-ISVersions"
* target-ejb="ISType"
* target-multiple="yes"
* cascade-delete="yes"
* @jboss.relation fk-constraint="true"
* related-pk-field="id"
* fk-column="s_istype_fk"
*/
public abstract ISTypeLocal getISType();
/**
* Type of this Information System Version
* @ejb.interface-method view-type="local"
*/
public abstract void setISType(ISTypeLocal type);
/**
* Updates made with this IS Version
* @ejb.interface-method view-type="local"
* @ejb.relation name="ISVersion-OneToMany-ISUpdates-Bi"
* role-name="ISVersion-has-ISUpdates"
*/
public abstract Set getISUpdates();
/**
* Updates made with this IS Version
* @ejb.interface-method view-type="local"
*/
public abstract void setISUpdates(Set updates);
/**
* Generated bulk accessor
* @ejb.interface-method
*/
public abstract ISVersionData getData();
/** Generated bulk accessor */
public abstract void setData(ISVersionData data);
// Implementation of EntityBean ---------------------------------------------
/**
* Create a new Information System Version
* @ejb.create-method
*/
public String ejbCreate(ISVersionData data, ISTypeLocal type) throws javax.ejb.CreateException{
if (data.getId() != null){
setId(data.getId());
setData(data);
}
else throw new javax.ejb.CreateException("Identifier for ISVersion must be non null.");
return null;
}
/** Create a new Information System Version */
public void ejbPostCreate(ISVersionData data, ISTypeLocal type) throws javax.ejb.CreateException{
setISType(type);
}
/**
* Remove this Information System Version
* @ejb.transaction type="Mandatory"
*/
public void ejbRemove() throws javax.ejb.RemoveException, javax.ejb.EJBException {}
}
--- NEW FILE: ISystemBean.java ---
/*
* ISystemBean.java
*
* Created on 8 october 2002, 18:59
*/
package org.figure8.join.businessobjects.resource.ejb;
import org.figure8.join.businessobjects.resource.util.ISystemUtil;
import org.figure8.join.businessobjects.resource.interfaces.ISystemData;
import org.figure8.join.businessobjects.resource.interfaces.ISTypeLocal;
/**
* This is the representation of an Information System available from
* the portal part of the software project to Join. Information System has
* a specific type (Many IS could be reached from the current project to join).<br>
* This bean is deployed with name "ISystem" cause we can't use "IS" that is
* a reserved EJB-QL identifier.
* @author <a href="mailto:lau...@fr...">Laurent Broudoux</a>
*
* @ejb.bean name="ISystem"
type="CMP" cmp-version="2.x" view-type="local"
jndi-name="${objects.res.is.jndi-name}"
local-jndi-name="${objects.res.is.jndi-name}Local"
primkey-field="id"
* @ejb.home local-class="org.figure8.join.businessobjects.resource.interfaces.ISystemLocalHome"
* @ejb.interface local-class="org.figure8.join.businessobjects.resource.interfaces.ISystemLocal"
* @ejb.data-object package="org.figure8.join.businessobjects.resource.interfaces"
*
* @ejb.finder signature="Collection findAll()" unchecked="true" transaction-type="NotSupported"
* @ejb.finder signature="Collection findByTypeAndName(org.figure8.join.businessobjects.resource.interfaces.ISTypeLocal type, java.lang.String name)"
unchecked="true" transaction-type="Supports"
query="SELECT DISTINCT OBJECT(sys) FROM ISystem AS sys WHERE sys.iSType=?1 AND sys.name=?2"
*
* @ejb.pk class="java.lang.String" generate="false" unchecked="true"
* @ejb.persistence table-name="${objects.res.is.table-name}"
*
* @jboss.tuned-updates "true"
* @jboss.read-ahead strategy="on-find"
*/
public abstract class ISystemBean implements javax.ejb.EntityBean{
// Public -------------------------------------------------------------------
/**
* Information System id
* @ejb.pk-field
* @ejb.persistence column-name="s_id"
*/
public abstract String getId();
/** Information System id */
public abstract void setId(String id);
/**
* Information System name
* @ejb.interface-method
* @ejb.persistence column-name="s_name"
*/
public abstract String getName();
/**
* Information System name
* @ejb.interface-method
*/
public abstract void setName(String name);
/**
* Type of this Information System
* @ejb.interface-method view-type="local"
* @ejb.relation name="ISType-OneToMany-ISs-Bi"
* role-name="IS-belongsto-ISType"
* cascade-delete="yes"
* @jboss.relation fk-constraint="true"
* related-pk-field="id"
* fk-column="s_istype_fk"
*/
public abstract ISTypeLocal getISType();
/**
* Type of this Information System
* @ejb.interface-method view-type="local"
*/
public abstract void setISType(ISTypeLocal type);
/**
* Generated bulk accessor
* @ejb.interface-method
*/
public abstract ISystemData getData();
/** Generated bulk accessor */
public abstract void setData(ISystemData data);
// Implementation of EntityBean ---------------------------------------------
/**
* Create a new Information System
* @ejb.create-method
*/
public String ejbCreate(ISystemData data, ISTypeLocal type) throws javax.ejb.CreateException{
if (data != null){
setId(ISystemUtil.generateGUID(this));
setData(data);
}
else throw new javax.ejb.CreateException("Data object for IS must be non null.");
return null;
}
/** Create a new Information System */
public void ejbPostCreate(ISystemData data, ISTypeLocal type) throws javax.ejb.CreateException{
setISType(type);
}
/**
* Remove this Resource
* @ejb.transaction type="Mandatory"
*/
public void ejbRemove() throws javax.ejb.RemoveException, javax.ejb.EJBException {}
}
|