|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.zkoss.zkplus.hibernate.HibernateUtil
public class HibernateUtil
Utitlity to access Hibernate Session. This implemenation works with the Hibernate's thread session context (version 3.1+). That is, you have to specified hibernate's configuration file "hibernate.cfg.xml" to as follows:
<session-factory> ... <property name="current_session_context_class">thread</property> </session-factory>Also notice that the zkplus.jar must be put under application's WEB-INF/lib because the SessionFactory is stored as a class static member.
| Constructor Summary | |
|---|---|
HibernateUtil()
|
|
| Method Summary | |
|---|---|
static void |
closeSession()
Wrapping HibernateUtil.getSessionFactory().getCurrentSession().close() into a simple API. |
static org.hibernate.Session |
currentSession()
Wrapping HibernateUtil.getSessionFactory().getCurrentSession() into a simple API. |
static org.hibernate.SessionFactory |
getSessionFactory()
Get the singleton hibernate Session Factory. |
| 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 static org.hibernate.SessionFactory getSessionFactory()
public static org.hibernate.Session currentSession()
throws org.hibernate.HibernateException
org.hibernate.HibernateException
public static void closeSession()
throws org.hibernate.HibernateException
org.hibernate.HibernateException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||