org.davesag.generica.peer
Class MediaPeer

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

public class MediaPeer
extends Object

This peer manipulates Media hibernate.

Since:
Visuality Lite 1.0.0
Version:
CVS Revision $Id: MediaPeer.java,v 1.5 2004/03/30 10:12:57 norm Exp $
Author:
Dave Sag http://www.davesag.com

Constructor Summary
MediaPeer()
           
 
Method Summary
static void delete(Session sess, Media media)
          Delete this Media.
static boolean exists(Session sess, String id)
          A quick tests to determine if the id supplied matched a known Media.
static Media load(Session sess, String id)
          Load the Media with the supplied id only, if valid.
static Long save(Session sess, Media media)
          Save this Media.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MediaPeer

public MediaPeer()
Method Detail

save

public static Long save(Session sess,
                        Media media)
Save this Media.

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

delete

public static void delete(Session sess,
                          Media media)
Delete this Media.

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

exists

public static boolean exists(Session sess,
                             String id)
A quick tests to determine if the id supplied matched a known Media. This is much faster that using load below.

Parameters:
sess - The Session to use to query for the Media.
id - The id number to test.
Returns:
true if the username supplied corresponds to a known Media.

load

public static Media load(Session sess,
                         String id)
Load the Media with the supplied id only, if valid.

Parameters:
sess - The Session to use to query for the Media.
id - The id of the Media we wish to load.
Returns:
The matching Media o or null.


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