org.davesag.generica.peer
Class SiteCopyPeer

java.lang.Object
  extended byorg.davesag.generica.peer.SiteCopyPeer

public class SiteCopyPeer
extends Object

This peer manipulates SiteCopy s using hibernate.

Since:
Generica 1.0
Version:
CVS Revision $Id: SiteCopyPeer.java,v 1.11 2004/03/30 13:00:41 davesag Exp $
Author:
Dave Sag http://www.davesag.com

Constructor Summary
SiteCopyPeer()
           
 
Method Summary
static void delete(Session sess, SiteCopy sitecopy)
          Delete this SiteCopy.
static List loadAll(Session sess, User author, Locale loc)
          Loads all the SiteCopy authored by the given otional User, optionally using the locale as a qualifier.
static SiteCopy loadLatest(Session sess, String section, Locale loc)
          Loads the most recently modified SiteCopy in the given section optionally using the locale as a qualifier.
static Long save(Session sess, SiteCopy sitecopy)
          Save this SiteCopy.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SiteCopyPeer

public SiteCopyPeer()
Method Detail

save

public static Long save(Session sess,
                        SiteCopy sitecopy)
Save this SiteCopy.

Parameters:
sess - The Session to use to save the SiteCopy. The session will be flushed but not closed.
sitecopy - The SiteCopy.
Returns:
The ID of the saved SiteCopy, or null if there was an error.

delete

public static void delete(Session sess,
                          SiteCopy sitecopy)
Delete this SiteCopy.

Parameters:
sess - The Session to use to delete the SiteCopy. The session will be flushed but not closed.
sitecopy - The SiteCopy.

loadAll

public static List loadAll(Session sess,
                           User author,
                           Locale loc)
Loads all the SiteCopy authored by the given otional User, optionally using the locale as a qualifier. If the User is null this method will return SiteCopy by any author. If loc is null it will return SiteCopy in any language.

Parameters:
sess - The Hiberante Session.
author - The User who wrote the text, or null.
loc - The Locale we are interested in, or null if we don't care about language.
Returns:
A List of all the SiteCopy objects or an empty list, never null.

loadLatest

public static SiteCopy loadLatest(Session sess,
                                  String section,
                                  Locale loc)
Loads the most recently modified SiteCopy in the given section optionally using the locale as a qualifier.

Parameters:
sess - The Hiberante Session.
section - The section you want SiteCopy for.
loc - The Locale we are interested in, or null if we don't care about language.
Returns:
A piece of SiteCopy or null if there is none.
Throws:
RuntimeException - if the params are invalid.


Dave Sag Generica API version 0.5.9 - (prerelease) Copyright 2003 - 2004 Dave Sag.