Dashboard > AWare > ... > Persistence > HibernateUnitOfWorkListener
HibernateUnitOfWorkListener Log In | Sign Up   View a printable version of the current page.

Added by jboner , last edited by jboner on Oct 11, 2004  (view change)
Labels: 
(None)

Overview

The HibernateUnitOfWorkListener is a UnitOfWorkListener that makes the Unit Of Work transaction work in conjunction with the Hibernate persistence service.

Hibernate is a powerful, ultra-high performance object/relational persistence and query service for Java.

Definition

You can define the HibernateUnitOfWorkListener in two ways, either using the SpringAspectContainer configuration file aware-config.xml or using a regular Java API.

Java API

Specify the org.codehaus.aware.unitofwork.hibernate.HibernateUnitOfWorkListener class as one of the listeners in the Class array passed to the UnitOfWork.initialize(Class[]) method:

UnitOfWork.initialize(new Class[]{HibernateUnitOfWorkListener.class});

Spring definition

Specify the org.codehaus.aware.unitofwork.hibernate.HibernateUnitOfWorkListener class name as one of the listeners in the property listeners:

<bean id="org.codehaus.aware.unitofwork.UnitOfWorkProtocol"
     class="org.codehaus.aware.unitofwork.UnitOfWorkProtocol"
    singleton="false">

    <property name="listeners">
        <list>
            <value>org.codehaus.aware.unitofwork.hibernate.HibernateUnitOfWorkListener</value>
             ...
        </list>
    </property>

</bean>

For the Spring definition to work you have to define the UnitOfWorkProtocol to use the SpringAspectContainer and not the default one.

Site running on a free Atlassian Confluence Open Source Project License granted to The Codehaus. Evaluate Confluence today.
Powered by Atlassian Confluence, the Enterprise Wiki. (Version: 2.6.2 Build:#919 Nov 26, 2007) - Bug/feature request - Contact Administrators