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

Quick Search    Search Deep

com.clra.rowing
Class RowingDBRead  view RowingDBRead download RowingDBRead.java

java.lang.Object
  extended bycom.clra.rowing.RowingDBRead

public final class RowingDBRead
extends java.lang.Object

This utility class defines common routines for reading snapshots from the database. In cases where read-only lists are presented to a user, these routines are faster than their ejbFind counterparts. However, data should never be written directly back to the database, otherwise in-memory caches maintained by EJB's will be out of synch and data will be corrupted. The class RowingUtils defines utilities with similar signatures that are implemented by calls to EJB's. These operations are appropriate if objects should be cached in memory because they will be modified shortly.

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

Field Summary
private static java.lang.String base
           
static java.text.SimpleDateFormat dateFormat
          The format used to specify a date and time to the database
static int NULL_INT
          Labels a null integer in the database, per JDBC
static java.text.SimpleDateFormat sdfConvert
          The format used to convert a date/time String to a Date
static java.text.SimpleDateFormat sdfDBDate
          The format used to get a date out of the data base
static java.text.SimpleDateFormat sdfDBTime
          The format used to get a time out of the data base
private static org.apache.log4j.Category theLog
           
 
Constructor Summary
private RowingDBRead()
          All utilities are static
 
Method Summary
static java.util.Collection findAllEnrollmentSnapshots(int member_id)
          Returns a collection of snapshots for all enrollments
static java.util.Collection findAllEnrollmentSnapshotsInRange(int member_id, java.util.Date start, java.util.Date finish)
          Returns a collection of snapshots for enrollments within an inclusive date range.
static java.util.Collection findAllRowingSessionSnapshots()
          Returns a collection of snapshots for all rowing sessions
static java.util.Collection findAllRowingSessionSnapshotsInRange(java.util.Date start, java.util.Date finish)
          Returns a collection of snapshots for rowing sessions within an inclusive date range.
static java.util.Collection findParticipant2SnapshotsForRowingSession(java.lang.Integer rowingId)
          Returns a collection of Participant2Snapshot instances for the specified rowing session.
static ParticipantSnapshot loadParticipant(java.lang.Integer participantId)
          Returns a Participant identified by a participant id.
static ParticipantSnapshot loadParticipant(java.lang.Integer memberId, java.lang.Integer rowingId)
          Returns a Participant identified by a member and rowing id.
static RowingSessionSnapshot loadRowingSession(java.lang.Integer rowingId)
           
static EnrollmentSnapshot mapResultSetToEnrollmentSnapshot(java.sql.ResultSet rs)
          Constructs an EnrollmentSnapshot from the current row of a result set.
static Participant2Snapshot mapResultSetToParticipant2Snapshot(java.sql.ResultSet rs)
          Constructs an Participant2Snapshot from the current row of a result set.
static ParticipantSnapshot mapResultSetToParticipantSnapshot(java.sql.ResultSet rs)
          Constructs an ParticipantSnapshot from the current row of a result set.
static RowingSessionSnapshot mapResultSetToRowingSessionSnapshot(java.sql.ResultSet rs)
           
 
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
Labels a null integer in the database, per JDBC

See Also:
Constant Field Values

dateFormat

public static final java.text.SimpleDateFormat dateFormat
The format used to specify a date and time to the database


sdfDBDate

public static final java.text.SimpleDateFormat sdfDBDate
The format used to get a date out of the data base


sdfDBTime

public static final java.text.SimpleDateFormat sdfDBTime
The format used to get a time out of the data base


sdfConvert

public static final java.text.SimpleDateFormat sdfConvert
The format used to convert a date/time String to a Date

Constructor Detail

RowingDBRead

private RowingDBRead()
All utilities are static

Method Detail

loadRowingSession

public static RowingSessionSnapshot loadRowingSession(java.lang.Integer rowingId)
                                               throws java.sql.SQLException,
                                                      RowingException,
                                                      javax.ejb.NoSuchEntityException

findAllRowingSessionSnapshots

public static java.util.Collection findAllRowingSessionSnapshots()
                                                          throws RowingException
Returns a collection of snapshots for all rowing sessions


findAllRowingSessionSnapshotsInRange

public static java.util.Collection findAllRowingSessionSnapshotsInRange(java.util.Date start,
                                                                        java.util.Date finish)
                                                                 throws RowingException
Returns a collection of snapshots for rowing sessions within an inclusive date range.


findAllEnrollmentSnapshots

public static java.util.Collection findAllEnrollmentSnapshots(int member_id)
                                                       throws RowingException
Returns a collection of snapshots for all enrollments


findAllEnrollmentSnapshotsInRange

public static java.util.Collection findAllEnrollmentSnapshotsInRange(int member_id,
                                                                     java.util.Date start,
                                                                     java.util.Date finish)
                                                              throws RowingException
Returns a collection of snapshots for enrollments within an inclusive date range.


loadParticipant

public static ParticipantSnapshot loadParticipant(java.lang.Integer participantId)
                                           throws java.sql.SQLException,
                                                  RowingException,
                                                  javax.ejb.NoSuchEntityException
Returns a Participant identified by a participant id.


loadParticipant

public static ParticipantSnapshot loadParticipant(java.lang.Integer memberId,
                                                  java.lang.Integer rowingId)
                                           throws java.sql.SQLException,
                                                  RowingException
Returns a Participant identified by a member and rowing id. The combination member_id/rowing_id is an alternate key on the Participant table. Therefore this routine returns either a null Participant or a unique Participant.


findParticipant2SnapshotsForRowingSession

public static java.util.Collection findParticipant2SnapshotsForRowingSession(java.lang.Integer rowingId)
                                                                      throws RowingException
Returns a collection of Participant2Snapshot instances for the specified rowing session.


mapResultSetToRowingSessionSnapshot

public static RowingSessionSnapshot mapResultSetToRowingSessionSnapshot(java.sql.ResultSet rs)
                                                                 throws java.sql.SQLException,
                                                                        RowingException

mapResultSetToParticipantSnapshot

public static ParticipantSnapshot mapResultSetToParticipantSnapshot(java.sql.ResultSet rs)
                                                             throws java.sql.SQLException,
                                                                    RowingException
Constructs an ParticipantSnapshot from the current row of a result set.


mapResultSetToParticipant2Snapshot

public static Participant2Snapshot mapResultSetToParticipant2Snapshot(java.sql.ResultSet rs)
                                                               throws java.sql.SQLException,
                                                                      RowingException
Constructs an Participant2Snapshot from the current row of a result set.


mapResultSetToEnrollmentSnapshot

public static EnrollmentSnapshot mapResultSetToEnrollmentSnapshot(java.sql.ResultSet rs)
                                                           throws java.sql.SQLException,
                                                                  RowingException
Constructs an EnrollmentSnapshot from the current row of a result set.