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

Quick Search    Search Deep

com.clra.member
Class MemberDBRead  view MemberDBRead download MemberDBRead.java

java.lang.Object
  extended bycom.clra.member.MemberDBRead

public final class MemberDBRead
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.

Version:
$Revision: 1.11 $ $Date: 2003/03/10 05:29:28 $

Field Summary
private static java.lang.String base
           
private static java.text.SimpleDateFormat sdfDBDate
          The format used to get a date out of the data base
private 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 MemberDBRead()
          All utilities are static
 
Method Summary
static java.util.Collection findAllMembersByLastName()
          Finds all active members of the CLRA.
static MemberSnapshot findMemberByAccountName(java.lang.String accountName)
          Finds the member that has the given account name.
static MemberSnapshot findMemberByMemberId(java.lang.Integer memberId)
          An alias for ${link #loadMember(Integer) loadMember(Integer)}.
static java.util.Collection findMembersWithLastNamesGTE(java.lang.String lower)
          Finds all active members with last names greater than or equal to the specified String.
static java.util.Collection findMembersWithLastNamesInRange(java.lang.String lower, java.lang.String upper)
          Finds all active members with last names greater than or equal to the specified lower bound, and less than the specified upper bound.
static java.util.Collection findMembersWithLastNamesLT(java.lang.String upper)
          Finds all active members with last names less than the specified String.
static MemberSnapshot loadMember(java.lang.Integer memberId)
          Finds the member that has the given member id.
(package private) static MemberSnapshot loadMember(java.sql.PreparedStatement stmt)
           
static java.util.Collection loadMemberCollection(java.sql.PreparedStatement stmt)
           
static MemberRole[] loadMemberRoles(int member_id)
           
static java.util.HashSet loadMemberRolesSet(java.sql.PreparedStatement stmt)
           
static MemberSnapshot mapResultSetToMemberSnapshot(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

sdfDBDate

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


sdfDBTime

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

Constructor Detail

MemberDBRead

private MemberDBRead()
All utilities are static

Method Detail

findAllMembersByLastName

public static java.util.Collection findAllMembersByLastName()
                                                     throws MemberException
Finds all active members of the CLRA. Members are sorted by lastname-firstname.


findMembersWithLastNamesGTE

public static java.util.Collection findMembersWithLastNamesGTE(java.lang.String lower)
                                                        throws MemberException
Finds all active members with last names greater than or equal to the specified String. Selection is case-insensitive. Members are sorted by lastname-firstname.


findMembersWithLastNamesLT

public static java.util.Collection findMembersWithLastNamesLT(java.lang.String upper)
                                                       throws MemberException
Finds all active members with last names less than the specified String. Selection is case-insensitive. Members are sorted by lastname-firstname.


findMembersWithLastNamesInRange

public static java.util.Collection findMembersWithLastNamesInRange(java.lang.String lower,
                                                                   java.lang.String upper)
                                                            throws MemberException
Finds all active members with last names greater than or equal to the specified lower bound, and less than the specified upper bound. Selection is case-insensitive. Members are sorted by lastname-firstname.


findMemberByAccountName

public static MemberSnapshot findMemberByAccountName(java.lang.String accountName)
                                              throws MemberException,
                                                     javax.ejb.NoSuchEntityException
Finds the member that has the given account name. Account names are unique, so this "finder" returns at most one member.


findMemberByMemberId

public static MemberSnapshot findMemberByMemberId(java.lang.Integer memberId)
                                           throws MemberException,
                                                  javax.ejb.NoSuchEntityException
An alias for ${link #loadMember(Integer) loadMember(Integer)}.


loadMember

public static MemberSnapshot loadMember(java.lang.Integer memberId)
                                 throws MemberException,
                                        javax.ejb.NoSuchEntityException
Finds the member that has the given member id. Member id's are unique, so this "finder" returns at most one snapshot.


loadMember

static MemberSnapshot loadMember(java.sql.PreparedStatement stmt)
                          throws java.sql.SQLException,
                                 MemberException,
                                 javax.ejb.NoSuchEntityException,
                                 javax.ejb.EJBException

loadMemberCollection

public static java.util.Collection loadMemberCollection(java.sql.PreparedStatement stmt)
                                                 throws java.sql.SQLException,
                                                        MemberException,
                                                        javax.ejb.NoSuchEntityException,
                                                        javax.ejb.EJBException

loadMemberRoles

public static MemberRole[] loadMemberRoles(int member_id)
                                    throws MemberException

loadMemberRolesSet

public static java.util.HashSet loadMemberRolesSet(java.sql.PreparedStatement stmt)
                                            throws java.sql.SQLException,
                                                   MemberException,
                                                   javax.ejb.NoSuchEntityException,
                                                   javax.ejb.EJBException

mapResultSetToMemberSnapshot

public static MemberSnapshot mapResultSetToMemberSnapshot(java.sql.ResultSet rs)
                                                   throws java.sql.SQLException,
                                                          MemberException