org.davesag.generica.peer
Class MerchantPeer

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

public class MerchantPeer
extends Object

This peer manipulates Merchant s using hibernate.

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

Constructor Summary
MerchantPeer()
           
 
Method Summary
static void delete(Session sess, Merchant merchant)
          Delete this merchant.
static Merchant load(Session sess, Long merchantid)
          Load a merchant with a given merchantID.
static Merchant load(Session sess, String name)
          Load a merchant with a given name.
static Long save(Session sess, Merchant merchant)
          Saves this Merchant.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MerchantPeer

public MerchantPeer()
Method Detail

save

public static Long save(Session sess,
                        Merchant merchant)
Saves this Merchant.

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

delete

public static void delete(Session sess,
                          Merchant merchant)
Delete this merchant.

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

load

public static Merchant load(Session sess,
                            Long merchantid)
Load a merchant with a given merchantID.

Parameters:
sess - the hibernate session.
merchantid - the id of the merchant to load.
Returns:
the merchant with the given id.

load

public static Merchant load(Session sess,
                            String name)
Load a merchant with a given name.

Parameters:
sess - the hibernate session.
name - the name of the merchant to load.
Returns:
the merchant with the given name.


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