org.mftech.dawn.server.persistence
Class HibernateUtil
java.lang.Object
org.mftech.dawn.server.persistence.HibernateUtil
public class HibernateUtil
- extends java.lang.Object
|
Field Summary |
static java.lang.ThreadLocal |
session
|
| Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
session
public static final java.lang.ThreadLocal session
HibernateUtil
public HibernateUtil()
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()