|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.xenonsoft.bridgetown.aop.transaction.hibernate.HibernateUtil
Utility object for Hibernate, contains static methods to retrieving the session factory and demarcating transactions.
This code is modified from Hibernate in Action book. See the classic book: "Hibernate in Action", by Bauer and King, publ. Manning. ISBN 1-932394-15-X
| Constructor Summary | |
HibernateUtil()
Default constructor |
|
| Method Summary | |
void |
afterPropertyInit()
Creates a Hibernate configuration and reads it from preference store. |
static void |
beginTransaction()
Begins a Hibernate transaction |
static void |
closeSession()
Close the Hibernate session |
static void |
commitTransaction()
Commits a Hibernate transaction |
void |
dispose()
Dispose of the hibernate session factory, if it was ever created |
java.lang.String |
getConfiguration()
Gets the Hibernate configuration |
java.util.List |
getPersistenceClasses()
Gets the persistenceClasses |
static net.sf.hibernate.Session |
getSession()
Open a new Hibernate or retrieve an existing Hibernate session |
static void |
rollbackTransaction()
Rolls back a Hibernate transaction |
void |
setConfiguration(java.lang.String configuration)
Sets the Hibernate configuration |
void |
setPersistenceClasses(java.util.List persistenceClasses)
Sets the persistenceClasses |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public HibernateUtil()
| Method Detail |
public java.lang.String getConfiguration()
public void setConfiguration(java.lang.String configuration)
configuration - the new value for configurationpublic java.util.List getPersistenceClasses()
public void setPersistenceClasses(java.util.List persistenceClasses)
persistenceClasses - The persistenceClasses to set.public void afterPropertyInit()
afterPropertyInit in interface IAfterPropertyInjectionInfrastructureException - if a persistence class cannot be found or loaded successfullypublic void dispose()
dispose in interface IDisposableIDisposable.dispose()public static net.sf.hibernate.Session getSession()
public static void closeSession()
public static void beginTransaction()
public static void commitTransaction()
public static void rollbackTransaction()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||