org.apache.turbine.om.security.peer
Class TurbineUserPeer

java.lang.Object
  extended byorg.apache.torque.util.BasePeer
      extended byorg.apache.turbine.om.security.peer.TurbineUserPeer
All Implemented Interfaces:
java.io.Serializable, UserPeer

public class TurbineUserPeer
extends org.apache.torque.util.BasePeer
implements UserPeer

This class handles all the database access for the User/User table. This table contains all the information for a given user.

Version:
$Id: TurbineUserPeer.java 280284 2005-09-12 07:57:42Z henning $
Author:
Frank Y. Kim, John D. McNally, Brett McLaughlin
See Also:
Serialized Form

Field Summary
static java.lang.String[] columnNames
          The names of the columns.
static java.lang.String CONFIRM_DATA
          This is the value that is stored in the database for confirmed users.
static java.lang.String CONFIRM_VALUE
          The key name for the confirm_value field.
static java.lang.String CREATED
          The key name for the created field.
static java.lang.String[] criteriaKeys
          The keys for the criteria.
static java.lang.String EMAIL
          The key name for the email field.
static java.lang.String FIRST_NAME
          The key name for the first name field.
static java.lang.String LAST_LOGIN
          The key name for the last_login field.
static java.lang.String LAST_NAME
          The key name for the last name field.
static java.lang.String MODIFIED
          The key name for the modified field.
static java.lang.String OBJECT_DATA
          The key name for the object_data field.
static java.lang.String PASSWORD
          The key name for the password field.
static java.lang.String USER_ID
          The key name for the visitor id field.
static java.lang.String USERNAME
          The key name for the username field.
 
Fields inherited from class org.apache.torque.util.BasePeer
DEFAULT_MAP_BUILDER, IGNORE_CASE, log, ORDER_BY
 
Constructor Summary
TurbineUserPeer()
           
 
Method Summary
static void addSelectColumns(org.apache.torque.util.Criteria criteria)
          Add all the columns needed to create a new object
static org.apache.torque.util.Criteria buildCriteria(User user)
          Builds a criteria object based upon an User object.
static boolean checkExists(User user)
          Checks if a User is defined in the system.
static java.util.List doSelect(org.apache.torque.util.Criteria criteria)
          Issues a select based on a criteria.
static java.util.List doSelect(org.apache.torque.util.Criteria criteria, java.sql.Connection dbConn)
          Issues a select based on a criteria.
static java.util.List doSelect(org.apache.torque.util.Criteria criteria, User current)
          Issues a select based on a criteria.
static void doUpdate(org.apache.torque.util.Criteria criteria)
          Issues an update based on a criteria.
static java.lang.String getColumnName(java.lang.String name)
          Returns the full name of a column.
 java.lang.String getFullColumnName(java.lang.String name)
          Returns the full name of a column.
static java.lang.Class getOMClass()
          The type of User this peer will instantiate.
protected static org.apache.torque.map.TableMap getTableMap()
          Returns the TableMap related to this peer.
static java.lang.String getTableName()
          Get the name of this table.
static void populateObject(com.workingdogs.village.Record row, int offset, User obj)
           
static User row2Object(com.workingdogs.village.Record row, int offset, java.lang.Class cls)
          Implementss torque peers' method.
static java.util.List selectAllConfirmedUsers()
          Returns a vector of all confirmed User objects.
static java.util.List selectAllUsers()
          Returns a vector of all User objects.
 
Methods inherited from class org.apache.torque.util.BasePeer
createPreparedStatement, createQueryString, deleteAll, deleteAll, doDelete, doDelete, doInsert, doInsert, doPSSelect, doPSSelect, doUpdate, doUpdate, doUpdate, executeQuery, executeQuery, executeQuery, executeQuery, executeQuery, executeQuery, executeStatement, executeStatement, executeStatement, getMapBuilder, getMapBuilder, getSelectResults, getSelectResults, getSelectResults, getSelectResults, handleMultipleRecords, hashtableToByteArray, initColumnNames, initCriteriaKeys, initTableColumns, initTableSchema, initTableSchema
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CONFIRM_DATA

public static final java.lang.String CONFIRM_DATA
This is the value that is stored in the database for confirmed users.

See Also:
Constant Field Values

USER_ID

public static final java.lang.String USER_ID
The key name for the visitor id field.


USERNAME

public static final java.lang.String USERNAME
The key name for the username field.


PASSWORD

public static final java.lang.String PASSWORD
The key name for the password field.


FIRST_NAME

public static final java.lang.String FIRST_NAME
The key name for the first name field.


LAST_NAME

public static final java.lang.String LAST_NAME
The key name for the last name field.


MODIFIED

public static final java.lang.String MODIFIED
The key name for the modified field.


CREATED

public static final java.lang.String CREATED
The key name for the created field.


EMAIL

public static final java.lang.String EMAIL
The key name for the email field.


LAST_LOGIN

public static final java.lang.String LAST_LOGIN
The key name for the last_login field.


CONFIRM_VALUE

public static final java.lang.String CONFIRM_VALUE
The key name for the confirm_value field.


OBJECT_DATA

public static final java.lang.String OBJECT_DATA
The key name for the object_data field.


columnNames

public static java.lang.String[] columnNames
The names of the columns.


criteriaKeys

public static java.lang.String[] criteriaKeys
The keys for the criteria.

Constructor Detail

TurbineUserPeer

public TurbineUserPeer()
Method Detail

getTableName

public static java.lang.String getTableName()
Get the name of this table.

Returns:
A String with the name of the table.

getColumnName

public static java.lang.String getColumnName(java.lang.String name)
Returns the full name of a column.

Parameters:
name - name of a column
Returns:
A String with the full name of the column.

getFullColumnName

public java.lang.String getFullColumnName(java.lang.String name)
Returns the full name of a column.

Specified by:
getFullColumnName in interface UserPeer
Parameters:
name - name of a column
Returns:
A String with the full name of the column.

buildCriteria

public static org.apache.torque.util.Criteria buildCriteria(User user)
Builds a criteria object based upon an User object. Data stored in the permData table which a key matching a column name is removed from the permData table and added as a criterion. All remaining data in the permData table is serialized and added as a criterion for the OBJECT_DATA column.

Parameters:
user - object to build the criteria
Returns:
the Criteria

addSelectColumns

public static void addSelectColumns(org.apache.torque.util.Criteria criteria)
                             throws org.apache.torque.TorqueException
Add all the columns needed to create a new object

Parameters:
criteria - The criteria to use.
Throws:
org.apache.torque.TorqueException - a generic exception.

populateObject

public static void populateObject(com.workingdogs.village.Record row,
                                  int offset,
                                  User obj)
                           throws org.apache.torque.TorqueException
Parameters:
row -
offset -
obj -
Throws:
org.apache.torque.TorqueException

doSelect

public static java.util.List doSelect(org.apache.torque.util.Criteria criteria)
                               throws org.apache.torque.TorqueException
Issues a select based on a criteria.

Parameters:
criteria - Object containing data that is used to create the SELECT statement.
Returns:
Vector containing TurbineUser objects.
Throws:
org.apache.torque.TorqueException - a generic exception.

doSelect

public static java.util.List doSelect(org.apache.torque.util.Criteria criteria,
                                      User current)
                               throws org.apache.torque.TorqueException
Issues a select based on a criteria.

Parameters:
criteria - Object containing data that is used to create the SELECT statement.
current - User object that is to be used as part of the results - if not passed, then a new one is created.
Returns:
Vector containing TurbineUser objects.
Throws:
org.apache.torque.TorqueException - a generic exception.

doSelect

public static java.util.List doSelect(org.apache.torque.util.Criteria criteria,
                                      java.sql.Connection dbConn)
                               throws org.apache.torque.TorqueException
Issues a select based on a criteria.

Parameters:
criteria - Object containing data that is used to create the SELECT statement.
dbConn -
Returns:
List containing TurbineUser objects.
Throws:
org.apache.torque.TorqueException - a generic exception.

row2Object

public static User row2Object(com.workingdogs.village.Record row,
                              int offset,
                              java.lang.Class cls)
                       throws org.apache.torque.TorqueException
Implementss torque peers' method. Does not use the Class argument as Users need to go through TurbineSecurity

Throws:
org.apache.torque.TorqueException - a generic exception.

getOMClass

public static java.lang.Class getOMClass()
                                  throws java.lang.Exception
The type of User this peer will instantiate.

Throws:
java.lang.Exception - a generic exception.

doUpdate

public static void doUpdate(org.apache.torque.util.Criteria criteria)
                     throws org.apache.torque.TorqueException
Issues an update based on a criteria. The criteria only uses USER_ID.

Parameters:
criteria - Object containing data that is used to create the UPDATE statement.
Throws:
org.apache.torque.TorqueException - a generic exception.

checkExists

public static boolean checkExists(User user)
                           throws DataBackendException,
                                  java.lang.Exception
Checks if a User is defined in the system. The name is used as query criteria.

Parameters:
user - The User to be checked.
Returns:
true if given User exists in the system.
Throws:
DataBackendException - when more than one User with the same name exists.
java.lang.Exception - a generic exception.

selectAllUsers

public static java.util.List selectAllUsers()
                                     throws java.lang.Exception
Returns a vector of all User objects.

Returns:
A Vector with all users in the system.
Throws:
java.lang.Exception - a generic exception.

selectAllConfirmedUsers

public static java.util.List selectAllConfirmedUsers()
                                              throws java.lang.Exception
Returns a vector of all confirmed User objects.

Returns:
A Vector with all confirmed users in the system.
Throws:
java.lang.Exception - a generic exception.

getTableMap

protected static org.apache.torque.map.TableMap getTableMap()
Returns the TableMap related to this peer. This method is not needed for general use but a specific application could have a need.



Copyright © 2000-2005 Apache Software Foundation. All Rights Reserved.