[hibernate-dev] OGM just got simpler

Emmanuel Bernard emmanuel at hibernate.org
Fri Mar 18 11:39:04 EDT 2011


No more nasty @Persister annotations on your entities, they now look like plain old ones.
When using JPA and as long as you use a TransactionManager (ie JTA support), the configuration is very simple

<persistence xmlns="http://java.sun.com/xml/ns/persistence"
             xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
             xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd"
             version="2.0">

    <persistence-unit name="org.hibernate.ogm.tutorial.jpa" transaction-type="JTA">
        <!-- Use Hibernate OGM provider: configuration will be transparent -->
        <provider>org.hibernate.ogm.jpa.HibernateOgmPersistence</provider>
        <properties>
            <!-- or any transaction manager lookup implementation you want in your environment -->
            <property name="hibernate.transaction.manager_lookup_class" 
                      value="org.hibernate.transaction.JBossTSStandaloneTransactionManagerLookup" />
        </properties>
    </persistence-unit>
</persistence>

More info here http://community.jboss.org/wiki/HowtosetupanduseHibernateOGM


More information about the hibernate-dev mailing list