org.davesag.generica.peer
Class FaqPeer

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

public class FaqPeer
extends Object

This peer manipulates Faq s using hibernate.

Since:
Generica 1.0
Version:
CVS Revision $Id: FaqPeer.java,v 1.13 2004/04/06 15:40:41 davesag Exp $
Author:
Dave Sag http://www.davesag.com

Constructor Summary
FaqPeer()
           
 
Method Summary
static boolean asked(Session sess, String question, Locale loc)
          Has this question already been asked in this Locale?
static void delete(Session sess, Faq faq)
          Delete this faq.
static List loadAll(Session sess, Locale loc)
          Loads all the Faq with the given optional Locale.
static Long save(Session sess, Faq faq)
          Sets the last modified date and saves this Faq.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FaqPeer

public FaqPeer()
Method Detail

save

public static Long save(Session sess,
                        Faq faq)
Sets the last modified date and saves this Faq.

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

delete

public static void delete(Session sess,
                          Faq faq)
Delete this faq.

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

asked

public static boolean asked(Session sess,
                            String question,
                            Locale loc)
Has this question already been asked in this Locale?

Parameters:
sess - The Session to use to delete the faq. The session will be flushed but not closed.
question - The question.
loc - The Locale.
Returns:
true if there is a Faq with the supplied question and in the supplied Locale's language.
Throws:
RuntimeException - if the params were invalid, or if an internal exception was encountered.

loadAll

public static List loadAll(Session sess,
                           Locale loc)
Loads all the Faq with the given optional Locale. Orders by lastModified date.

Parameters:
sess - The Session to use to delete the Faq. The session will be flushed but not closed.
loc - The Locale.
Returns:
List of Faq s.


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