org.liquidsite.core.data
Class PreferencePeer

java.lang.Object
  extended byorg.liquidsite.core.data.AbstractPeer
      extended byorg.liquidsite.core.data.PreferencePeer

public class PreferencePeer
extends AbstractPeer

A user preference database peer. This class contains static methods that handles all accesses to the LS_PREFERENCE table.


Method Summary
static void doDeleteDomain(DataSource src, java.lang.String domain)
          Deletes all preferences in a domain from the data source.
static void doDeleteUser(DataSource src, java.lang.String domain, java.lang.String user)
          Deletes all preferences for a user from the data source.
static void doInsert(DataSource src, PreferenceData data)
          Inserts a new preference into the data source.
static java.util.ArrayList doSelectByUser(DataSource src, java.lang.String domain, java.lang.String user)
          Returns a list of preferences for a specified user.
protected  AbstractData getDataObject()
          Returns a new instance of the data object.
 
Methods inherited from class org.liquidsite.core.data.AbstractPeer
count, delete, insert, select, selectList, update
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

doSelectByUser

public static java.util.ArrayList doSelectByUser(DataSource src,
                                                 java.lang.String domain,
                                                 java.lang.String user)
                                          throws DataObjectException
Returns a list of preferences for a specified user.

Parameters:
src - the data source to use
domain - the domain name
user - the user name
Returns:
a list of preferences for the user
Throws:
DataObjectException - if the data source couldn't be accessed properly

doInsert

public static void doInsert(DataSource src,
                            PreferenceData data)
                     throws DataObjectException
Inserts a new preference into the data source.

Parameters:
src - the data source to use
data - the preference data object
Throws:
DataObjectException - if the data source couldn't be accessed properly

doDeleteDomain

public static void doDeleteDomain(DataSource src,
                                  java.lang.String domain)
                           throws DataObjectException
Deletes all preferences in a domain from the data source.

Parameters:
src - the data source to use
domain - the domain name
Throws:
DataObjectException - if the data source couldn't be accessed properly

doDeleteUser

public static void doDeleteUser(DataSource src,
                                java.lang.String domain,
                                java.lang.String user)
                         throws DataObjectException
Deletes all preferences for a user from the data source.

Parameters:
src - the data source to use
domain - the domain name
user - the user name
Throws:
DataObjectException - if the data source couldn't be accessed properly

getDataObject

protected AbstractData getDataObject()
Returns a new instance of the data object.

Specified by:
getDataObject in class AbstractPeer
Returns:
a new instance of the data object