org.apache.jetspeed.om.registry.database
Class BaseJetspeedPortletPeer

java.lang.Object
  |
  +--org.apache.torque.util.BasePeer
        |
        +--org.apache.jetspeed.om.registry.database.BaseJetspeedPortletPeer
All Implemented Interfaces:
DBRegistry, java.io.Serializable

public class BaseJetspeedPortletPeer
extends org.apache.torque.util.BasePeer
implements DBRegistry

Base Peer for Portlet Parameter registry entries.

Version:
$Id: BaseJetspeedPortletPeer.java,v 1.3 2004/04/06 23:00:16 morciuch Exp $
Author:
Suchisubhra Sinha
See Also:
Serialized Form

Field Summary
static java.lang.String APPLICATION
          the column name for the APPLICATION field
static java.lang.String CACHEDONURL
          the column name for the CACHEDONURL field
protected static java.lang.Class CLASS_DEFAULT
          A class that can be returned by this peer.
static java.lang.String CLASSNAME
          the column name for the CLASSNAME field
protected static java.lang.String CLASSNAME_DEFAULT
          A class that can be returned by this peer.
static java.lang.String DESCRIPTION
          the column name for the DESCRIPTION field
static java.lang.String HIDDEN
          the column name for the HIDDEN field
static java.lang.String IMAGE
          the column name for the IMAGE field
static java.lang.String LASTUPDATE
          the column name for the field
protected static org.apache.jetspeed.services.logging.JetspeedLogger logger
          Static initialization of the logger for this class
static java.lang.String NAME
          the column name for the NAME field
static int numColumns
          number of columns for this peer
static java.lang.String PARENT
          the column name for the PARENT field
static java.lang.String PORTAL_ID
          the column name for the PORTAL_ID field
static java.lang.String ROLE
          the column name for the ROLE field
static java.lang.String SECURITY
          the column name for the SECURITY field
static java.lang.String TABLE_NAME
          the table name for this class
static java.lang.String TITLE
          the column name for the TITLE field
static java.lang.String TYPE
          the column name for the TYPE field
static java.lang.String URL
          the column name for the URL field
 
Fields inherited from class org.apache.torque.util.BasePeer
DEFAULT_MAP_BUILDER, IGNORE_CASE, log, ORDER_BY
 
Fields inherited from interface org.apache.jetspeed.om.registry.DBRegistry
DATABASE_NAME
 
Constructor Summary
BaseJetspeedPortletPeer()
           
 
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()
          Build a Criteria object
static org.apache.torque.util.Criteria buildCriteria(org.apache.torque.om.ObjectKey pk)
          Build a Criteria object from an ObjectKey
static void buildPortletCategory(int id, org.apache.jetspeed.om.registry.base.BasePortletEntry obj)
          it will make the category types for this portlet
static void buildPortletMedia(int id, org.apache.jetspeed.om.registry.base.BasePortletEntry obj)
          it will make the media types for this portlet
static void buildPortletParameters(int id, org.apache.jetspeed.om.registry.base.BasePortletEntry obj)
          it will make the parameters for this portlet
static java.util.List doSelect(org.apache.torque.util.Criteria criteria)
          Method to do selects.
static java.util.List doSelect(org.apache.torque.util.Criteria criteria, java.sql.Connection con)
          Method to do selects within a transaction.
static java.util.List doSelectVillageRecords(org.apache.torque.util.Criteria criteria)
          Grabs the raw Village records to be formed into objects.
static java.util.List doSelectVillageRecords(org.apache.torque.util.Criteria criteria, java.sql.Connection con)
          Grabs the raw Village records to be formed into objects.
static java.lang.Class getOMClass()
          The class that the Peer will make instances of.
 java.util.List getXREGDataFromDb()
          Method to get regsitered data from database.
 boolean isModified(java.lang.String lastUpdateDate)
          Method to data.
static void populateObject(com.workingdogs.village.Record row, int offset, org.apache.jetspeed.om.registry.base.BasePortletEntry obj)
          Populates an object from a resultset row starting from a specified offset.
static java.util.List populateObjects(java.util.List records)
          The returned List will contain objects of the default type or objects that inherit from the default.
static java.util.List resultSet2Objects(java.sql.ResultSet results)
          Get the list of objects for a ResultSet.
static org.apache.jetspeed.om.registry.base.BasePortletEntry row2Object(com.workingdogs.village.Record row, int offset, java.lang.Class cls)
          Create a new object of type cls from a resultset row starting from a specified offset.
 
Methods inherited from class org.apache.torque.util.BasePeer
createPreparedStatement, createQueryString, deleteAll, deleteAll, doDelete, doDelete, doInsert, doInsert, doPSSelect, doPSSelect, doUpdate, 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

logger

protected static final org.apache.jetspeed.services.logging.JetspeedLogger logger
Static initialization of the logger for this class


TABLE_NAME

public static final java.lang.String TABLE_NAME
the table name for this class

See Also:
Constant Field Values

PORTAL_ID

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


NAME

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


HIDDEN

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


CLASSNAME

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


TYPE

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


APPLICATION

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


PARENT

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


URL

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


CACHEDONURL

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


ROLE

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


TITLE

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


DESCRIPTION

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


IMAGE

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


SECURITY

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


LASTUPDATE

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


numColumns

public static final int numColumns
number of columns for this peer

See Also:
Constant Field Values

CLASSNAME_DEFAULT

protected static final java.lang.String CLASSNAME_DEFAULT
A class that can be returned by this peer.

See Also:
Constant Field Values

CLASS_DEFAULT

protected static final java.lang.Class CLASS_DEFAULT
A class that can be returned by this peer.

Constructor Detail

BaseJetspeedPortletPeer

public BaseJetspeedPortletPeer()
Method Detail

resultSet2Objects

public static java.util.List resultSet2Objects(java.sql.ResultSet results)
                                        throws org.apache.torque.TorqueException
Get the list of objects for a ResultSet. Please not that your resultset MUST return columns in the right order. You can use getFieldNames() in BaseObject to get the correct sequence.

Parameters:
results - the ResultSet
Returns:
the list of objects
Throws:
org.apache.torque.TorqueException - Any exceptions caught during processing will be rethrown wrapped into a TorqueException.

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 - object containing the columns to add.
Throws:
org.apache.torque.TorqueException - Any exceptions caught during processing will be rethrown wrapped into a TorqueException.

row2Object

public static org.apache.jetspeed.om.registry.base.BasePortletEntry row2Object(com.workingdogs.village.Record row,
                                                                               int offset,
                                                                               java.lang.Class cls)
                                                                        throws org.apache.torque.TorqueException
Create a new object of type cls from a resultset row starting from a specified offset. This is done so that you can select other rows than just those needed for this object. You may for example want to create two objects from the same row.

Throws:
org.apache.torque.TorqueException - Any exceptions caught during processing will be rethrown wrapped into a TorqueException.

populateObject

public static void populateObject(com.workingdogs.village.Record row,
                                  int offset,
                                  org.apache.jetspeed.om.registry.base.BasePortletEntry obj)
                           throws org.apache.torque.TorqueException
Populates an object from a resultset row starting from a specified offset. This is done so that you can select other rows than just those needed for this object. You may for example want to create two objects from the same row.

Throws:
org.apache.torque.TorqueException - Any exceptions caught during processing will be rethrown wrapped into a TorqueException.

getXREGDataFromDb

public java.util.List getXREGDataFromDb()
                                 throws org.apache.torque.TorqueException
Method to get regsitered data from database.

Specified by:
getXREGDataFromDb in interface DBRegistry
Returns:
List of selected Objects
Throws:
org.apache.torque.TorqueException - Any exceptions caught during processing will be rethrown wrapped into a TorqueException.

isModified

public boolean isModified(java.lang.String lastUpdateDate)
Description copied from interface: DBRegistry
Method to data.

Specified by:
isModified in interface DBRegistry
Returns:
boolean if data has been modified

doSelect

public static java.util.List doSelect(org.apache.torque.util.Criteria criteria)
                               throws org.apache.torque.TorqueException
Method to do selects.

Parameters:
criteria - object used to create the SELECT statement.
Returns:
List of selected Objects
Throws:
org.apache.torque.TorqueException - Any exceptions caught during processing will be rethrown wrapped into a TorqueException.

doSelect

public static java.util.List doSelect(org.apache.torque.util.Criteria criteria,
                                      java.sql.Connection con)
                               throws org.apache.torque.TorqueException
Method to do selects within a transaction.

Parameters:
criteria - object used to create the SELECT statement.
con - the connection to use
Returns:
List of selected Objects
Throws:
org.apache.torque.TorqueException - Any exceptions caught during processing will be rethrown wrapped into a TorqueException.

doSelectVillageRecords

public static java.util.List doSelectVillageRecords(org.apache.torque.util.Criteria criteria)
                                             throws org.apache.torque.TorqueException
Grabs the raw Village records to be formed into objects. This method handles connections internally. The Record objects returned by this method should be considered readonly. Do not alter the data and call save(), your results may vary, but are certainly likely to result in hard to track MT bugs.

Throws:
org.apache.torque.TorqueException - Any exceptions caught during processing will be rethrown wrapped into a TorqueException.

doSelectVillageRecords

public static java.util.List doSelectVillageRecords(org.apache.torque.util.Criteria criteria,
                                                    java.sql.Connection con)
                                             throws org.apache.torque.TorqueException
Grabs the raw Village records to be formed into objects. This method should be used for transactions

Parameters:
con - the connection to use
Throws:
org.apache.torque.TorqueException - Any exceptions caught during processing will be rethrown wrapped into a TorqueException.

populateObjects

public static java.util.List populateObjects(java.util.List records)
                                      throws org.apache.torque.TorqueException
The returned List will contain objects of the default type or objects that inherit from the default.

Throws:
org.apache.torque.TorqueException - Any exceptions caught during processing will be rethrown wrapped into a TorqueException.

buildCriteria

public static org.apache.torque.util.Criteria buildCriteria(org.apache.torque.om.ObjectKey pk)
Build a Criteria object from an ObjectKey


buildCriteria

public static org.apache.torque.util.Criteria buildCriteria()
Build a Criteria object


getOMClass

public static java.lang.Class getOMClass()
                                  throws org.apache.torque.TorqueException
The class that the Peer will make instances of. If the BO is abstract then you must implement this method in the BO.

Throws:
org.apache.torque.TorqueException - Any exceptions caught during processing will be rethrown wrapped into a TorqueException.

buildPortletParameters

public static void buildPortletParameters(int id,
                                          org.apache.jetspeed.om.registry.base.BasePortletEntry obj)
                                   throws org.apache.torque.TorqueException
it will make the parameters for this portlet

org.apache.torque.TorqueException

buildPortletMedia

public static void buildPortletMedia(int id,
                                     org.apache.jetspeed.om.registry.base.BasePortletEntry obj)
                              throws org.apache.torque.TorqueException
it will make the media types for this portlet

org.apache.torque.TorqueException

buildPortletCategory

public static void buildPortletCategory(int id,
                                        org.apache.jetspeed.om.registry.base.BasePortletEntry obj)
                                 throws org.apache.torque.TorqueException
it will make the category types for this portlet

org.apache.torque.TorqueException


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