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

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

public class RolePeer
extends org.apache.torque.util.BasePeer

This class handles all the database access for the ROLE table. This table contains all the roles that a given member can play.

Version:
$Id: RolePeer.java 264148 2005-08-29 14:21:04Z henning $
Author:
Frank Y. Kim, John D. McNally, Brett McLaughlin
See Also:
Serialized Form

Field Summary
static java.lang.String NAME
          The column name for the name field.
static java.lang.String OBJECTDATA
          The column name for the ObjectData field
static java.lang.String ROLE_ID
          The column name for the role id field.
 
Fields inherited from class org.apache.torque.util.BasePeer
DEFAULT_MAP_BUILDER, IGNORE_CASE, log, ORDER_BY
 
Constructor Summary
RolePeer()
           
 
Method Summary
static org.apache.torque.util.Criteria buildCriteria(Role role)
          Builds a criteria object based upon an Role object
static boolean checkExists(Role role)
          Checks if a Role is defined in the system.
static java.util.List doSelect(org.apache.torque.util.Criteria criteria)
          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.
static java.lang.String getTableName()
          Get the name of this table.
static RoleSet retrieveSet(org.apache.torque.util.Criteria criteria)
          Retrieves/assembles a RoleSet based on the Criteria passed in
static RoleSet retrieveSet(User user, Group group)
          Retrieves a set of Roles that an User was assigned in a Group
 
Methods inherited from class org.apache.torque.util.BasePeer
createPreparedStatement, createQueryString, deleteAll, deleteAll, doDelete, doDelete, doInsert, doInsert, doPSSelect, doPSSelect, doSelect, 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

ROLE_ID

public static final java.lang.String ROLE_ID
The column name for the role id field.


NAME

public static final java.lang.String NAME
The column name for the name field.


OBJECTDATA

public static final java.lang.String OBJECTDATA
The column name for the ObjectData field

Constructor Detail

RolePeer

public RolePeer()
Method Detail

retrieveSet

public static RoleSet retrieveSet(org.apache.torque.util.Criteria criteria)
                           throws java.lang.Exception
Retrieves/assembles a RoleSet based on the Criteria passed in

Parameters:
criteria - The criteria to use.
Returns:
a RoleSet
Throws:
java.lang.Exception - a generic exception.

retrieveSet

public static RoleSet retrieveSet(User user,
                                  Group group)
                           throws java.lang.Exception
Retrieves a set of Roles that an User was assigned in a Group

Parameters:
user - An user.
group - A group
Returns:
A Set of Roles of this User in the Group
Throws:
java.lang.Exception - a generic exception.

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 Role objects.
Throws:
org.apache.torque.TorqueException - a generic exception.

buildCriteria

public static org.apache.torque.util.Criteria buildCriteria(Role role)
Builds a criteria object based upon an Role object

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

doUpdate

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

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(Role role)
                           throws DataBackendException,
                                  java.lang.Exception
Checks if a Role is defined in the system. The name is used as query criteria.

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

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.


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