Important

Setup

  1. Read UsingHibernateToMakeYourJavaBeansPersistent to perform the integration of Hibernate with Cocoon. Run the test sample to see that Hibernate is working properly.

  2. Copy the contents of the hib path (in the zip file, attached to this page), into the WEB-INF/classes/hib folder under your Cocoon directory.

  3. Copy the contents of form2bean2hib path (in the zip file, attached to this page), into a form2bean2hib folder under your Cocoon directory

  4. Add the following line into your cocoon.xconf (this adds the Avalon component that creates the Hibernate session):

<component role="hib.PersistenceFactory" class="hib.HibernateFactory"/>
  1. Create the table in your mysql database with the mysql.sql script (in the zip file, attached to this page).

  2. Copy the hibernate.properties file (in the zip file, attached to this page) into the WEB-INF/classes folder under Cocoon. Edit the file to specify the appropriate login credentials for your database. Note: Hibernate has support for many different databases. Change the SQL dialect in hibernate.properties and edit the above script if you don't use mysql but something else.

  3. Restart Tomcat. Near the end of the debug info in the console output (stdout.log in the Tomcat logs directory), there should be a line reading Hibernate initialize called. If you don't see this line, one of the points above went wrong.

  4. Try http://.../form2bean2hib/ (where "..." is the path to your application under Cocoon).

Explanation

DerekH



Attachment: form2bean2hib.zip

CformsHibernateAndFlow (last edited 2009-09-20 23:39:49 by localhost)