Betty v1.1.0

christophedelory.betty.ejb
Class PlayerScoreBean

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

public abstract class PlayerScoreBean
extends AbstractEntityBean
implements EntityBean, DbEntity

The entity bean definition of a player score in a championship's event.

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

Field Summary
 
Fields inherited from class christophedelory.ejb.AbstractEntityBean
context
 
Constructor Summary
PlayerScoreBean()
           
 
Method Summary
 Object ejbCreate(LocalEvent dbEvent, LocalPlayer dbPlayer, LocalPhase dbDependencyPhase, int dependencyPhaseRank)
          Creates an instance of this entity bean.
 void ejbPostCreate(LocalEvent dbEvent, LocalPlayer dbPlayer, LocalPhase dbDependencyPhase, int dependencyPhaseRank)
          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  LocalPhase getDependencyPhase()
          Returns the dependency phase allowing to choose the player (which is not known now in this case).
abstract  int getDependencyPhaseRank()
          Returns the rank in the dependency phase allowing to choose the player (which is not known now in this case).
abstract  LocalEvent getEvent()
          Returns the enclosing championship's event.
abstract  LocalPlayer getPlayer()
          Returns the associated player.
abstract  int getRank()
          Returns the current player rank value.
abstract  Integer getResult()
          Returns the current player result.
abstract  int getScore()
          Returns the current player score.
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 setDependencyPhase(LocalPhase phase)
          Initializes the dependency phase allowing to choose the player (which is not known now in this case).
abstract  void setDependencyPhaseRank(int rank)
          Initializes the rank in the dependency phase allowing to choose the player (which is not known now in this case).
abstract  void setEvent(LocalEvent event)
          Initializes the enclosing championship's event.
abstract  void setPlayer(LocalPlayer player)
          Initializes the associated player.
abstract  void setRank(int rank)
          Initializes the player rank value.
abstract  void setResult(Integer result)
          Initializes the player result value.
abstract  void setScore(int score)
          Initializes the player score value.
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

PlayerScoreBean

public PlayerScoreBean()
Method Detail

getScore

public abstract int getScore()
Returns the current player score. There is no constraint on its value.

Returns:
a score value.
Throws:
EJBException - if any exception occured during the execution of this method.
See Also:
setScore(int)

setScore

public abstract void setScore(int score)
Initializes the player score value.

Parameters:
score - a score value.
Throws:
EJBException - if any exception occured during the execution of this method.
See Also:
getScore()

getRank

public abstract int getRank()
Returns the current player rank value.

Returns:
a rank value. Shall be strictly greater than 0.
Throws:
EJBException - if any exception occured during the execution of this method.
See Also:
setRank(int)

setRank

public abstract void setRank(int rank)
Initializes the player rank value.

Parameters:
rank - a rank value. Shall be strictly greater than 0.
Throws:
EJBException - if any exception occured during the execution of this method.
See Also:
getRank()

getResult

public abstract Integer getResult()
Returns the current player result. There is no constraint on its value.

Returns:
a result value. May be null.
Throws:
EJBException - if any exception occured during the execution of this method.
See Also:
setResult(Integer)

setResult

public abstract void setResult(Integer result)
Initializes the player result value.

Parameters:
result - a result value. May be null.
Throws:
EJBException - if any exception occured during the execution of this method.
See Also:
getResult()

getDependencyPhaseRank

public abstract int getDependencyPhaseRank()
Returns the rank in the dependency phase allowing to choose the player (which is not known now in this case).

Returns:
a rank value. Shall be strictly greater than 0.
Throws:
EJBException - if any exception occured during the execution of this method.
See Also:
setDependencyPhaseRank(int), getDependencyPhase()

setDependencyPhaseRank

public abstract void setDependencyPhaseRank(int rank)
Initializes the rank in the dependency phase allowing to choose the player (which is not known now in this case).

Parameters:
rank - a rank value. Shall be strictly greater than 0.
Throws:
EJBException - if any exception occured during the execution of this method.
See Also:
getDependencyPhaseRank(), setDependencyPhase(christophedelory.betty.interfaces.LocalPhase)

getEvent

public abstract LocalEvent getEvent()
Returns the enclosing championship's event.
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:
an event. Shall not be null.
Throws:
EJBException - if any exception occured during the execution of this method.
See Also:
setEvent(christophedelory.betty.interfaces.LocalEvent)

setEvent

public abstract void setEvent(LocalEvent event)
Initializes the enclosing championship's event.

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

getPlayer

public abstract LocalPlayer getPlayer()
Returns the associated player.
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 player. May be null if not known now.
Throws:
EJBException - if any exception occured during the execution of this method.
See Also:
setPlayer(christophedelory.betty.interfaces.LocalPlayer), getDependencyPhase()

setPlayer

public abstract void setPlayer(LocalPlayer player)
Initializes the associated player.

Parameters:
player - a player. May be null.
Throws:
EJBException - if any exception occured during the execution of this method.
See Also:
getPlayer()

getDependencyPhase

public abstract LocalPhase getDependencyPhase()
Returns the dependency phase allowing to choose the player (which is not known now in this case).
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. May be null.
Throws:
EJBException - if any exception occured during the execution of this method.
See Also:
setDependencyPhase(christophedelory.betty.interfaces.LocalPhase), getDependencyPhaseRank()

setDependencyPhase

public abstract void setDependencyPhase(LocalPhase phase)
Initializes the dependency phase allowing to choose the player (which is not known now in this case).

Parameters:
phase - a phase. May be null.
Throws:
EJBException - if any exception occured during the execution of this method.
See Also:
getDependencyPhase(), setDependencyPhaseRank(int)

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(LocalEvent dbEvent,
                        LocalPlayer dbPlayer,
                        LocalPhase dbDependencyPhase,
                        int dependencyPhaseRank)
                 throws CreateException
Creates an instance of this entity bean.

Parameters:
dbEvent - the enclosing event. Shall not be null.
dbPlayer - the associated player. May be null if not known now.
dbDependencyPhase - the dependency phase, if player is not known now. May be null only if dbPlayer is not null.
dependencyPhaseRank - the rank in the dependency phase. Shall be strictly greater than 0.
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(LocalEvent dbEvent,
                          LocalPlayer dbPlayer,
                          LocalPhase dbDependencyPhase,
                          int dependencyPhaseRank)
                   throws CreateException,
                          NamingException
Allows this entity bean instance to fully initialize itself.

Parameters:
dbEvent - the enclosing event. Shall not be null.
dbPlayer - the associated player. May be null if not known now.
dbDependencyPhase - the dependency phase, if player is not known now. May be null only if dbPlayer is not null.
dependencyPhaseRank - the rank in the dependency phase. Shall be strictly greater than 0.
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.