Betty v1.1.0

christophedelory.betty.ejb
Class EventBean

java.lang.Object
  extended by christophedelory.ejb.AbstractEntityBean
      extended by christophedelory.betty.ejb.EventBean
All Implemented Interfaces:
DbIdEntity, DbEntity, Serializable, EnterpriseBean, EntityBean

public abstract class EventBean
extends AbstractEntityBean
implements EntityBean, DbIdEntity

The entity bean definition of an event in a championship's phase.

Version:
$Revision: 85 $
Author:
Christophe Delory
See Also:
EventDetails, Serialized Form

Field Summary
 
Fields inherited from class christophedelory.ejb.AbstractEntityBean
context
 
Constructor Summary
EventBean()
           
 
Method Summary
 Object ejbCreate(String id, LocalPhase dbPhase)
          Creates an instance of this entity bean.
 void ejbPostCreate(String id, LocalPhase dbPhase)
          Allows this entity bean instance to fully initialize itself.
abstract  LocalBase getBase()
          Returns the base EJB object attached to this EJB object.
 Date getCreationDate()
          Returns the creation date of this EJB object.
 String getCreationUserId()
          Returns the identifier of the user having created this EJB object.
abstract  Date getDate()
          Returns the event's date.
abstract  String getId()
          Returns the object identifier.
abstract  LocalLocation getLocation()
          Returns the event's location.
abstract  LocalPhase getPhase()
          Returns the enclosing championship's phase.
abstract  LocalModel getScoreModel()
          Returns the associated score processing model.
abstract  Date getUpdateDate()
          Returns the update date of this EJB object.
abstract  String getUpdateUserId()
          Returns the identifier of the user having performed the last update on this EJB object.
abstract  void setBase(LocalBase dbBase)
          Initializes the associated EJB object.
abstract  void setDate(Date date)
          Initializes the event's date.
abstract  void setId(String id)
          Initializes the object identifier.
abstract  void setLocation(LocalLocation location)
          Initializes the event's location.
abstract  void setPhase(LocalPhase phase)
          Initializes the enclosing championship's phase.
abstract  void setScoreModel(LocalModel dbModel)
          Initializes the associated score processing model.
abstract  void setUpdateDate(Date date)
          Initializes the update date of this EJB object.
abstract  void setUpdateUserId(String userId)
          Initializes the identifier of the user having performed the last update on this EJB object.
 
Methods inherited from class christophedelory.ejb.AbstractEntityBean
ejbActivate, ejbLoad, ejbPassivate, ejbRemove, ejbStore, setEntityContext, unsetEntityContext
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface javax.ejb.EntityBean
ejbActivate, ejbLoad, ejbPassivate, ejbRemove, ejbStore, setEntityContext, unsetEntityContext
 

Constructor Detail

EventBean

public EventBean()
Method Detail

getId

public abstract String getId()
Description copied from interface: DbIdEntity
Returns the object identifier.

Specified by:
getId in interface DbIdEntity
Returns:
an object identifier. Shall not be null.
See Also:
DbIdEntity.setId(String)

setId

public abstract void setId(String id)
Description copied from interface: DbIdEntity
Initializes the object identifier.

Specified by:
setId in interface DbIdEntity
Parameters:
id - an object identifier. Shall not be null.
See Also:
DbIdEntity.getId()

getDate

public abstract Date getDate()
Returns the event's date.

Returns:
a date. Shall not be null.
Throws:
EJBException - if any exception occured during the execution of this method.
See Also:
setDate(java.util.Date)

setDate

public abstract void setDate(Date date)
Initializes the event's date.

Parameters:
date - a date. Shall not be null.
Throws:
EJBException - if any exception occured during the execution of this method.
See Also:
getDate()

getScoreModel

public abstract LocalModel getScoreModel()
Returns the associated score processing model.
Foreign key fields must be nullable by default. This is because the CMP specification requires an insert into the database after the ejbCreate method and an update to it after to pick up CMR changes made in ejbPostCreate. Since the EJB specification does not allow a relationship to be modified until ejbPostCreate, a foreign key will be initially set to null.

Returns:
a score processing model. Shall not be null.
Throws:
EJBException - if any exception occured during the execution of this method.
See Also:
setScoreModel(christophedelory.betty.interfaces.LocalModel)

setScoreModel

public abstract void setScoreModel(LocalModel dbModel)
Initializes the associated score processing model.

Parameters:
dbModel - a score processing model. Shall not be null.
Throws:
EJBException - if any exception occured during the execution of this method.
See Also:
getScoreModel()

getPhase

public abstract LocalPhase getPhase()
Returns the enclosing championship's phase.
Foreign key fields must be nullable by default. This is because the CMP specification requires an insert into the database after the ejbCreate method and an update to it after to pick up CMR changes made in ejbPostCreate. Since the EJB specification does not allow a relationship to be modified until ejbPostCreate, a foreign key will be initially set to null.

Returns:
a phase. Shall not be null.
Throws:
EJBException - if any exception occured during the execution of this method.
See Also:
setPhase(christophedelory.betty.interfaces.LocalPhase)

setPhase

public abstract void setPhase(LocalPhase phase)
Initializes the enclosing championship's phase.

Parameters:
phase - a phase. Shall not be null.
Throws:
EJBException - if any exception occured during the execution of this method.
See Also:
getPhase()

getLocation

public abstract LocalLocation getLocation()
Returns the event's location.
Foreign key fields must be nullable by default. This is because the CMP specification requires an insert into the database after the ejbCreate method and an update to it after to pick up CMR changes made in ejbPostCreate. Since the EJB specification does not allow a relationship to be modified until ejbPostCreate, a foreign key will be initially set to null.

Returns:
a location. Shall not be null.
Throws:
EJBException - if any exception occured during the execution of this method.
See Also:
setLocation(christophedelory.betty.interfaces.LocalLocation)

setLocation

public abstract void setLocation(LocalLocation location)
Initializes the event's location.

Parameters:
location - a location. Shall not be null.
Throws:
EJBException - if any exception occured during the execution of this method.
See Also:
getLocation()

getCreationDate

public Date getCreationDate()
Description copied from interface: DbEntity
Returns the creation date of this EJB object.

Specified by:
getCreationDate in interface DbEntity
Returns:
a date. Shall not be null.
Since:
0.9.2

getCreationUserId

public String getCreationUserId()
Description copied from interface: DbEntity
Returns the identifier of the user having created this EJB object.

Specified by:
getCreationUserId in interface DbEntity
Returns:
a user identifier. Shall not be null.
Since:
0.9.2

getUpdateDate

public abstract Date getUpdateDate()
Description copied from interface: DbEntity
Returns the update date of this EJB object.

Specified by:
getUpdateDate in interface DbEntity
Returns:
a date. Shall not be null.
See Also:
DbEntity.setUpdateDate(java.util.Date), DbEntity.getUpdateUserId()

setUpdateDate

public abstract void setUpdateDate(Date date)
Description copied from interface: DbEntity
Initializes the update date of this EJB object.

Specified by:
setUpdateDate in interface DbEntity
Parameters:
date - a date. Shall not be null.
See Also:
DbEntity.getUpdateDate(), DbEntity.setUpdateUserId(String)

getUpdateUserId

public abstract String getUpdateUserId()
Description copied from interface: DbEntity
Returns the identifier of the user having performed the last update on this EJB object.

Specified by:
getUpdateUserId in interface DbEntity
Returns:
a user identifier. Shall not be null.
See Also:
DbEntity.setUpdateUserId(String), DbEntity.getUpdateDate()

setUpdateUserId

public abstract void setUpdateUserId(String userId)
Description copied from interface: DbEntity
Initializes the identifier of the user having performed the last update on this EJB object.

Specified by:
setUpdateUserId in interface DbEntity
Parameters:
userId - a user identifier. Shall not be null.
See Also:
DbEntity.getUpdateUserId(), DbEntity.setUpdateDate(java.util.Date)

getBase

public abstract LocalBase getBase()
Description copied from interface: DbEntity
Returns the base EJB object attached to this EJB object.
Foreign key fields must be nullable by default. This is because the CMP specification requires an insert into the database after the ejbCreate method and an update to it after to pick up CMR changes made in ejbPostCreate. Since the EJB specification does not allow a relationship to be modified until ejbPostCreate, a foreign key will be initially set to null.

Specified by:
getBase in interface DbEntity
Returns:
a base EJB object. Shall not be null.
See Also:
DbEntity.setBase(christophedelory.interfaces.LocalBase)

setBase

public abstract void setBase(LocalBase dbBase)
Description copied from interface: DbEntity
Initializes the associated EJB object.

Specified by:
setBase in interface DbEntity
Parameters:
dbBase - an EJB object. Shall not be null.
See Also:
DbEntity.getBase()

ejbCreate

public Object ejbCreate(String id,
                        LocalPhase dbPhase)
                 throws CreateException
Creates an instance of this entity bean.

Parameters:
id - the event identifier. Shall not be null.
dbPhase - the enclosing phase. Shall not be null.
Returns:
null (as EJB 2.0 spec says for CMP ejbCreate() methods).
Throws:
CreateException - the EJB object creation failed.
EJBException - if any exception occured during the execution of this method.

ejbPostCreate

public void ejbPostCreate(String id,
                          LocalPhase dbPhase)
                   throws CreateException,
                          NamingException
Allows this entity bean instance to fully initialize itself.

Parameters:
id - the event identifier. Shall not be null.
dbPhase - the enclosing phase. Shall not be null.
Throws:
CreateException - the EJB object creation failed.
NamingException - if a naming exception is encountered.
ClassCastException - indicates that the code has attempted to cast an object to a subclass of which it is not an instance.
EJBException - if any exception occured during the execution of this method.

© 2008-2009 Christophe Delory

Copyright © 2008-2009 Christophe Delory. All Rights Reserved.