org.controlhaus.hibernate
Class HibernateControlImpl

java.lang.Object
  extended by org.controlhaus.hibernate.HibernateControlImpl
All Implemented Interfaces:
HibernateControl

public class HibernateControlImpl
extends java.lang.Object
implements HibernateControl

The HibernateControl Implementation.

Since:
May 10, 2003
Author:
Dan Diephouse

Nested Class Summary
 
Nested classes/interfaces inherited from interface org.controlhaus.hibernate.HibernateControl
HibernateControl.ManagedTransactions
 
Constructor Summary
HibernateControlImpl()
           
 
Method Summary
 void closeSession()
          Close the session for the current Thread.
 net.sf.hibernate.cfg.Configuration getConfiguration()
           
 net.sf.hibernate.Session getSession()
           
 net.sf.hibernate.SessionFactory getSessionFactory()
          Get the Hibernate SessionFactory.
 net.sf.hibernate.Transaction getTransaction()
           
 void onCreate()
           
 void onRelease()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HibernateControlImpl

public HibernateControlImpl()
Method Detail

getSessionFactory

public net.sf.hibernate.SessionFactory getSessionFactory()
Description copied from interface: HibernateControl
Get the Hibernate SessionFactory.

Specified by:
getSessionFactory in interface HibernateControl
Returns:
See Also:
org.codehaus.plexus.hibernate.HibernateService#getSessionFactory()

getConfiguration

public net.sf.hibernate.cfg.Configuration getConfiguration()

onCreate

public void onCreate()

onRelease

public void onRelease()

getSession

public net.sf.hibernate.Session getSession()
                                    throws net.sf.hibernate.HibernateException
Specified by:
getSession in interface HibernateControl
Returns:
The session that is currently associated with this Thread. If there is no session yet, one will be created.
Throws:
net.sf.hibernate.HibernateException

getTransaction

public net.sf.hibernate.Transaction getTransaction()
Specified by:
getTransaction in interface HibernateControl
Returns:
The transaction for the current session. If there is no session or the control is not managing the transactions, it will return null.

closeSession

public void closeSession()
                  throws net.sf.hibernate.HibernateException
Description copied from interface: HibernateControl
Close the session for the current Thread. If there is no session it will fail gracefully and no exception is thrown.

Specified by:
closeSession in interface HibernateControl
Throws:
net.sf.hibernate.HibernateException


Copyright © 2004-2005 Controlhaus. All Rights Reserved.