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>
Since ZK 3.0.1, if your hibernate configuration file name is not the default "hibernate.cfg.xml", you can
specify it in WEB-INF/zk.xml. Just add following lines:
<preference>
<name>HibernateUtil.config</name>
<value>YOUR-HIBERNATE-FILENAME</value>
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.
author: henrichen
|