org.controlhaus.hibernate
Interface HibernateControl

All Known Implementing Classes:
HibernateControlBean, HibernateControlImpl

public interface HibernateControl

The HibernateControl allows easy session and transaction management between Beehive Controls and Hibernate. Use the ManagedTransactions property on the HibernateControl and transactions will be managed for you autmatically. The transaction will start at the first access to the session.

Since:
Oct 29, 2004
Author:
Dan Diephouse

Nested Class Summary
static interface HibernateControl.ManagedTransactions
           
 
Method Summary
 void closeSession()
          Close the session for the current Thread.
 net.sf.hibernate.Session getSession()
           
 net.sf.hibernate.SessionFactory getSessionFactory()
          Get the Hibernate SessionFactory.
 net.sf.hibernate.Transaction getTransaction()
           
 

Method Detail

getSessionFactory

net.sf.hibernate.SessionFactory getSessionFactory()
Get the Hibernate SessionFactory.

Returns:

getSession

net.sf.hibernate.Session getSession()
                                    throws net.sf.hibernate.HibernateException
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

net.sf.hibernate.Transaction getTransaction()
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

void closeSession()
                  throws net.sf.hibernate.HibernateException
Close the session for the current Thread. If there is no session it will fail gracefully and no exception is thrown.

Throws:
net.sf.hibernate.HibernateException


Copyright © 2004-2005 Controlhaus. All Rights Reserved.