Package net.commerce.zocalo.hibernate

HibernateUtil is a helper class for storing objects persistently using Hibernate.

See:
          Description

Class Summary
HibernateUtil Utilities for dealing with Hibernate.
NoDBCriteria a do-nothing implementation of Hibernate's Criteria that can be used when hibernate is disabled.
NoDBHibernateUtil Session management utilities for dealing with an absent database.
NoDBQuery a do-nothing implementation of Hibernate's Query that can be used when hibernate is disabled.
NoDBSession a do-nothing implementation of Hibernate's Session that can be used when hibernate is disabled.
NoDBSessionFactory a do-nothing implementation of Hibernate's SessionFactory that can be used when hibernate is disabled.
NoDBTransaction a do-nothing implementation of Hibernate's transaction that can be used when hibernate is disabled.
ShutdownDB Shut the database down cleanly.
 

Package net.commerce.zocalo.hibernate Description

HibernateUtil is a helper class for storing objects persistently using Hibernate.

The design allows a test version to be invoked at run time, so that hibernate calls in production code will not invoke database actions in non-persistent tests. If the test version is initialized with a non-persistent SessionFactory, then the currentSession() call will invoke a MockSession rather than a real one, and calls to session.save() or session.beginTransaction().commit() will not invoke db activity.

HibernateUtil.addClasses(Configuration) should have a line added for each new persistent class that is created. Test-only classes should be described in HibernateTestUtil instead.

© Copyright 2007 Chris Hibbert. All rights reserved.
© 2006 CommerceNet Consortium, LLC.

This software is published under the terms of the MIT license, a copy
of which has been included with this distribution in the LICENSE file.