2. JPA Configuration

The Auditable interface uses the Joda Time DateTime type. Joda Time's default configuration is set using the two properties below.

Excerpt from META-INF/persistence.xml

                
<?xml version="1.0" encoding="UTF-8"?>
<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_1.xsd"
             version="2.1">

    <persistence-unit name="hsql">
        <provider>org.hibernate.ejb.HibernatePersistence</provider>
        
        <properties>
            ...
            
            <property name="jadira.usertype.autoRegisterUserTypes" value="true" />
            <property name="jadira.usertype.databaseZone" value="jvm" />
        </properties>
    </persistence-unit>
    
</persistence>