org.davesag.generica.peer
Class LinkPeer

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

public class LinkPeer
extends Object

This peer manipulates Link s hibernate.

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

Constructor Summary
LinkPeer()
           
 
Method Summary
static void delete(Session sess, Link link)
          Delete this link.
static List loadAll(Session sess, Locale loc)
          Loads all the Link with the given optional Locale.
static List loadAll(Session sess, Locale loc, boolean validity)
          Loads all the Link with the given optional Locale, and the given validity flag.
static Long save(Session sess, Link link)
          Sets the last modified date and saves this Link.
static boolean validate(Session sess, Link link)
          Checks that the url of the Link provided actually resolves to something.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LinkPeer

public LinkPeer()
Method Detail

save

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

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

delete

public static void delete(Session sess,
                          Link link)
Delete this link.

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

validate

public static boolean validate(Session sess,
                               Link link)
Checks that the url of the Link provided actually resolves to something. If it does then set the link's valid flag to true and resave it. if not then set the valid flag to valse and resave it. return the validity status.

Parameters:
sess - The Session to use to save the link. The session will be flushed but not closed.
link - The Link.
Returns:
true if the url of the Link resolves to something, false if not.
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 Link with the given optional Locale. Orders by lastModified date.

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

loadAll

public static List loadAll(Session sess,
                           Locale loc,
                           boolean validity)
Loads all the Link with the given optional Locale, and the given validity flag. Orders by lastModified date.

Parameters:
sess - The Session to use to delete the Link. The session will be flushed but not closed.
loc - The Locale.
validity - the validity flag.
Returns:
List of Links.
Throws:
RuntimeException - if the params are invalid.


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