Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

com.clra.rowing.remote
Class ParticipantBean  view ParticipantBean download ParticipantBean.java

java.lang.Object
  extended bycom.clra.rowing.remote.ParticipantBean
All Implemented Interfaces:
javax.ejb.EnterpriseBean, javax.ejb.EntityBean, java.io.Serializable

public class ParticipantBean
extends java.lang.Object
implements javax.ejb.EntityBean

Version:
$Revision: 1.5 $ $Date: 2003/02/26 03:38:45 $

Field Summary
private  com.clra.rowing.Attendance _attendance
           
private  java.lang.Integer _finalSeatId
           
private  java.lang.Integer _initialSeatId
           
private  boolean _isDirty
           
private  java.lang.Integer _memberId
           
private  java.lang.Integer _participantId
           
private  java.lang.Integer _replacesId
           
private  java.lang.Integer _rowingId
           
private  com.clra.rowing.SeatPreference _seatPreference
           
private static java.lang.String base
           
private  javax.ejb.EntityContext context
           
static int NULL_INT
           
private static org.apache.log4j.Category theLog
           
 
Constructor Summary
ParticipantBean()
           
 
Method Summary
private  java.lang.Integer createWithSessionConstraint(java.lang.Integer memberId, java.lang.Integer rowingId, com.clra.rowing.SeatPreference sp, com.clra.rowing.RowingSessionState st)
           
private  void deleteRow(java.lang.Integer id)
           
 void ejbActivate()
           
 java.lang.Integer ejbCreate(java.lang.Integer memberId, java.lang.Integer rowingId, com.clra.rowing.SeatPreference preferred)
           
 java.lang.Integer ejbCreate(com.clra.member.MemberSnapshot member, com.clra.rowing.ParticipantSnapshot replaces)
          Creates a "substitute" participant; that is, a participant who is present at a rowing session as a substitute for another, signed-up participant.
 java.lang.Integer ejbCreate(com.clra.member.MemberSnapshot member, com.clra.rowing.RowingSessionSnapshot rowing)
          Creates an "extra" participant; that is, a participant who is present at a rowing session without signing up and who isn't substituting for another member.
 java.util.Collection ejbFindAll()
          Returns a collection of rowing sessions that fall within the inclusive date range.
 java.util.Collection ejbFindByMemberIdRowingId(java.lang.Integer memberId, java.lang.Integer rowingId)
           
 java.lang.Integer ejbFindByPrimaryKey(java.lang.Integer primaryKey)
           
 java.util.Collection ejbFindByRowingId(java.lang.Integer rowingId)
           
 void ejbLoad()
           
 void ejbPassivate()
           
 void ejbPostCreate(java.lang.Integer mId, java.lang.Integer rId, com.clra.rowing.SeatPreference sp)
           
 void ejbPostCreate(com.clra.member.MemberSnapshot ms, com.clra.rowing.ParticipantSnapshot ps)
           
 void ejbPostCreate(com.clra.member.MemberSnapshot ms, com.clra.rowing.RowingSessionSnapshot rss)
           
 void ejbRemove()
           
 void ejbStore()
           
 com.clra.rowing.Attendance getAttendance()
          Returns the attendance of a participant at a rowing session, or null if attendance has not been marked.
 com.clra.rowing.ParticipantSnapshot getData()
          Returns a snapshot of a participant
 com.clra.rowing.SeatSnapshot getFinalSeat()
          Returns the final seat assignment of this participant, or null if a final seating was not made.
 com.clra.rowing.SeatSnapshot getInitialSeat()
          Returns the initial seat assignment of this participant, or null if an initial seating was not made.
 java.lang.Integer getMemberId()
          Returns the primary key of the member that the participant represents.
 java.lang.Integer getParticipantId()
          Returns the primary key of a participant.
 java.lang.Integer getRowingId()
          Returns the primary key of the rowing session to which the participant belongs.
 com.clra.rowing.SeatPreference getSeatPreference()
          Returns the seat preference of a participant.
 com.clra.rowing.IParticipant getSubstitutedParticipant()
          Returns the participant for whom this participant is substituting.
private  void insertRowWithSessionConstraints(java.lang.Integer memberId, java.lang.Integer rowingId, java.lang.Integer participantId, com.clra.rowing.SeatPreference seatPreference, com.clra.rowing.RowingSessionState rsState)
           
private  void loadRow()
           
static java.lang.Integer nextId()
          A utility that gets (and reserves) the next id for a rowing session
private  java.util.Collection selectAll()
           
private  java.util.Collection selectByMemberIdRowingId(java.lang.Integer memberId, java.lang.Integer rowingId)
           
private  boolean selectByPrimaryKey(java.lang.Integer primaryKey)
           
private  java.util.Collection selectByRowingId(java.lang.Integer rowingId)
           
 void setAttendance(com.clra.rowing.Attendance attend, com.clra.rowing.IRowingSession session)
          Marks the attendance of a participant at a rowing session.
 void setEntityContext(javax.ejb.EntityContext context)
           
 void setFinalSeat(com.clra.rowing.SeatSnapshot seat, com.clra.rowing.IBoating boating)
          Assigns a final seating to a participant at the start of a rowing session, after attendance has been taken.
 void setInitialSeat(com.clra.rowing.SeatSnapshot seat, com.clra.rowing.IBoating boating)
          Assigns a preliminary seating to a participant before a rowing session starts.
 void setSeatPreference(com.clra.rowing.SeatPreference seatPreference)
          Sets the seat preference of a participant.
private  void storeRow()
           
 void unsetEntityContext()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

base

private static final java.lang.String base

theLog

private static final org.apache.log4j.Category theLog

NULL_INT

public static final int NULL_INT
See Also:
Constant Field Values

_isDirty

private transient boolean _isDirty

_rowingId

private java.lang.Integer _rowingId

_memberId

private java.lang.Integer _memberId

_participantId

private java.lang.Integer _participantId

_seatPreference

private com.clra.rowing.SeatPreference _seatPreference

_replacesId

private java.lang.Integer _replacesId

_initialSeatId

private java.lang.Integer _initialSeatId

_finalSeatId

private java.lang.Integer _finalSeatId

_attendance

private com.clra.rowing.Attendance _attendance

context

private javax.ejb.EntityContext context
Constructor Detail

ParticipantBean

public ParticipantBean()
Method Detail

getData

public com.clra.rowing.ParticipantSnapshot getData()
Returns a snapshot of a participant


getParticipantId

public java.lang.Integer getParticipantId()
Returns the primary key of a participant. The id is immutable after a participant is created.


getMemberId

public java.lang.Integer getMemberId()
Returns the primary key of the member that the participant represents. The id is immutable after a participant is created.


getRowingId

public java.lang.Integer getRowingId()
Returns the primary key of the rowing session to which the participant belongs. The id is immutable after a participant is created.


getSeatPreference

public com.clra.rowing.SeatPreference getSeatPreference()
Returns the seat preference of a participant. The seat preference is immutable after a participant is created. A signed-up participant is created with a seat preference; an extra participant is created without a seat preference; and a substitute participant is created without a seat preference (but seating algorithms should assign the substitute the same initial seat as the original participant).


setSeatPreference

public void setSeatPreference(com.clra.rowing.SeatPreference seatPreference)
                       throws com.clra.rowing.ParticipantStateException,
                              com.clra.rowing.RowingException
Sets the seat preference of a participant.


getSubstitutedParticipant

public com.clra.rowing.IParticipant getSubstitutedParticipant()
Returns the participant for whom this participant is substituting. The substitutee is immutable after a participant is created. For a signed-up or an extra participant, the substitutee is null. For a substitute participant, the substitutee is non-null.


setInitialSeat

public void setInitialSeat(com.clra.rowing.SeatSnapshot seat,
                           com.clra.rowing.IBoating boating)
                    throws com.clra.rowing.ParticipantStateException,
                           com.clra.rowing.RowingException
Assigns a preliminary seating to a participant before a rowing session starts.


getInitialSeat

public com.clra.rowing.SeatSnapshot getInitialSeat()
Returns the initial seat assignment of this participant, or null if an initial seating was not made.


setFinalSeat

public void setFinalSeat(com.clra.rowing.SeatSnapshot seat,
                         com.clra.rowing.IBoating boating)
                  throws com.clra.rowing.ParticipantStateException,
                         com.clra.rowing.RowingException
Assigns a final seating to a participant at the start of a rowing session, after attendance has been taken.


getFinalSeat

public com.clra.rowing.SeatSnapshot getFinalSeat()
Returns the final seat assignment of this participant, or null if a final seating was not made.


setAttendance

public void setAttendance(com.clra.rowing.Attendance attend,
                          com.clra.rowing.IRowingSession session)
                   throws com.clra.rowing.ParticipantStateException,
                          com.clra.rowing.RowingException
Marks the attendance of a participant at a rowing session.


getAttendance

public com.clra.rowing.Attendance getAttendance()
Returns the attendance of a participant at a rowing session, or null if attendance has not been marked.


ejbCreate

public java.lang.Integer ejbCreate(java.lang.Integer memberId,
                                   java.lang.Integer rowingId,
                                   com.clra.rowing.SeatPreference preferred)
                            throws javax.ejb.CreateException

ejbPostCreate

public void ejbPostCreate(java.lang.Integer mId,
                          java.lang.Integer rId,
                          com.clra.rowing.SeatPreference sp)

ejbCreate

public java.lang.Integer ejbCreate(com.clra.member.MemberSnapshot member,
                                   com.clra.rowing.RowingSessionSnapshot rowing)
                            throws java.rmi.RemoteException,
                                   javax.ejb.CreateException
Creates an "extra" participant; that is, a participant who is present at a rowing session without signing up and who isn't substituting for another member. The participant is constructed in the PRESENT state.


ejbPostCreate

public void ejbPostCreate(com.clra.member.MemberSnapshot ms,
                          com.clra.rowing.RowingSessionSnapshot rss)

ejbCreate

public java.lang.Integer ejbCreate(com.clra.member.MemberSnapshot member,
                                   com.clra.rowing.ParticipantSnapshot replaces)
                            throws javax.ejb.CreateException,
                                   java.rmi.RemoteException
Creates a "substitute" participant; that is, a participant who is present at a rowing session as a substitute for another, signed-up participant. The substitute is constructed in the PRESENT state, and the signed-up participant transitions to the ABSENT state.


ejbPostCreate

public void ejbPostCreate(com.clra.member.MemberSnapshot ms,
                          com.clra.rowing.ParticipantSnapshot ps)

createWithSessionConstraint

private java.lang.Integer createWithSessionConstraint(java.lang.Integer memberId,
                                                      java.lang.Integer rowingId,
                                                      com.clra.rowing.SeatPreference sp,
                                                      com.clra.rowing.RowingSessionState st)
                                               throws javax.ejb.CreateException

ejbFindByPrimaryKey

public java.lang.Integer ejbFindByPrimaryKey(java.lang.Integer primaryKey)
                                      throws javax.ejb.FinderException

ejbFindByMemberIdRowingId

public java.util.Collection ejbFindByMemberIdRowingId(java.lang.Integer memberId,
                                                      java.lang.Integer rowingId)
                                               throws javax.ejb.FinderException

ejbFindByRowingId

public java.util.Collection ejbFindByRowingId(java.lang.Integer rowingId)
                                       throws javax.ejb.FinderException

ejbFindAll

public java.util.Collection ejbFindAll()
                                throws javax.ejb.FinderException
Returns a collection of rowing sessions that fall within the inclusive date range.


ejbRemove

public void ejbRemove()
Specified by:
ejbRemove in interface javax.ejb.EntityBean

setEntityContext

public void setEntityContext(javax.ejb.EntityContext context)
Specified by:
setEntityContext in interface javax.ejb.EntityBean

unsetEntityContext

public void unsetEntityContext()
Specified by:
unsetEntityContext in interface javax.ejb.EntityBean

ejbActivate

public void ejbActivate()
Specified by:
ejbActivate in interface javax.ejb.EntityBean

ejbPassivate

public void ejbPassivate()
Specified by:
ejbPassivate in interface javax.ejb.EntityBean

ejbLoad

public void ejbLoad()
Specified by:
ejbLoad in interface javax.ejb.EntityBean

ejbStore

public void ejbStore()
Specified by:
ejbStore in interface javax.ejb.EntityBean

selectByPrimaryKey

private boolean selectByPrimaryKey(java.lang.Integer primaryKey)
                            throws java.sql.SQLException

selectByMemberIdRowingId

private java.util.Collection selectByMemberIdRowingId(java.lang.Integer memberId,
                                                      java.lang.Integer rowingId)
                                               throws java.sql.SQLException

selectByRowingId

private java.util.Collection selectByRowingId(java.lang.Integer rowingId)
                                       throws java.sql.SQLException

selectAll

private java.util.Collection selectAll()
                                throws java.sql.SQLException

insertRowWithSessionConstraints

private void insertRowWithSessionConstraints(java.lang.Integer memberId,
                                             java.lang.Integer rowingId,
                                             java.lang.Integer participantId,
                                             com.clra.rowing.SeatPreference seatPreference,
                                             com.clra.rowing.RowingSessionState rsState)
                                      throws javax.ejb.CreateException,
                                             java.sql.SQLException

deleteRow

private void deleteRow(java.lang.Integer id)
                throws javax.ejb.RemoveException,
                       java.sql.SQLException

loadRow

private void loadRow()
              throws java.sql.SQLException,
                     com.clra.rowing.RowingException,
                     javax.ejb.NoSuchEntityException

storeRow

private void storeRow()
               throws java.sql.SQLException

nextId

public static java.lang.Integer nextId()
                                throws java.sql.SQLException,
                                       javax.ejb.CreateException
A utility that gets (and reserves) the next id for a rowing session