org.zkoss.zkplus.hibernate
Class HibernateSessionFactoryListener

java.lang.Object
  extended by org.zkoss.zkplus.hibernate.HibernateSessionFactoryListener
All Implemented Interfaces:
org.zkoss.zk.ui.util.WebAppCleanup, org.zkoss.zk.ui.util.WebAppInit

public class HibernateSessionFactoryListener
extends java.lang.Object
implements org.zkoss.zk.ui.util.WebAppInit, org.zkoss.zk.ui.util.WebAppCleanup

Listener to init and cleanup the hibernate session factory automatically. This listener is used with OpenSessionInViewListener and HibernateUtil, or it will not work.

In WEB-INF/zk.xml, add following lines:


        <listener>
                <description>Hibernate SessionFactory Lifecycle</description>
                <listener-class>org.zkoss.zkplus.hibernate.HibernateSessionFactoryListener</listener-class>
        </listener>
 

Author:
henrichen

Constructor Summary
HibernateSessionFactoryListener()
           
 
Method Summary
 void cleanup(org.zkoss.zk.ui.WebApp wapp)
           
 void init(org.zkoss.zk.ui.WebApp wapp)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HibernateSessionFactoryListener

public HibernateSessionFactoryListener()
Method Detail

init

public void init(org.zkoss.zk.ui.WebApp wapp)
Specified by:
init in interface org.zkoss.zk.ui.util.WebAppInit

cleanup

public void cleanup(org.zkoss.zk.ui.WebApp wapp)
Specified by:
cleanup in interface org.zkoss.zk.ui.util.WebAppCleanup


Copyright © 2005-2007 Potix Corporation. All Rights Reserved.