org.mftech.dawn.server.persistence
Class HibernateUtil

java.lang.Object
  extended by org.mftech.dawn.server.persistence.HibernateUtil

public class HibernateUtil
extends java.lang.Object


Field Summary
static java.lang.ThreadLocal session
           
 
Constructor Summary
HibernateUtil()
           
 
Method Summary
static void closeSession()
           
static void closeSessionFactory()
           
static org.hibernate.Session currentSession()
          returns current session using thread-local
static org.hibernate.Session getCurrentSession()
          returns the current session using sessionfactory
static org.hibernate.SessionFactory getSessionFactory()
           
static boolean isOpenSession()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

session

public static final java.lang.ThreadLocal session
Constructor Detail

HibernateUtil

public HibernateUtil()
Method Detail

getSessionFactory

public static org.hibernate.SessionFactory getSessionFactory()
Returns:
the sessionFactory

currentSession

public static org.hibernate.Session currentSession()
                                            throws org.hibernate.HibernateException
returns current session using thread-local

Returns:
Throws:
org.hibernate.HibernateException

closeSession

public static void closeSession()
                         throws org.hibernate.HibernateException
Throws:
org.hibernate.HibernateException

getCurrentSession

public static org.hibernate.Session getCurrentSession()
returns the current session using sessionfactory

Returns:

closeSessionFactory

public static void closeSessionFactory()

isOpenSession

public static boolean isOpenSession()