3.2.2.3. Persistence Unit Properties

Hibernate 4.x configuration properties

JBoss EAP 6 automatically sets the following Hibernate 4.x configuration properties:

Table 3.3. Hibernate Persistence Unit Properties

Property Name Default Value Purpose
hibernate.id.new_generator_mappings true
This setting is relevant if you use @GeneratedValue(AUTO) to generate unique index key values for new entities. New applications should keep the default value of true. Existing applications that used Hibernate 3.3.x might need to change it to false to continue using a sequence object or table based generator and maintain backward compatibility. The application can override this value in the persistence.xml file.
More information on this behavior is provided below.
hibernate.transaction.jta.platform Instance of org.hibernate.service.jta.platform.spi.JtaPlatform Interface
This class passes the transaction manager, user transaction, and transaction synchronization registry into Hibernate.
hibernate.ejb.resource_scanner Instance of org.hibernate.ejb.packaging.Scanner Interface
This class knows how to use the JBoss EAP 6 annotation indexer to provide faster deployment.
hibernate.transaction.manager_lookup_class  
This property is removed if found in the persistence.xml because it could conflict with hibernate.transaction.jta.platform
hibernate.session_factory_name QUALIFIED_PERSISTENCE_UNIT_NAME
This is set to the application name + persistence unit name. The application can specify a different value, but it must be unique across all application deployments on the JBoss EAP 6 instance.
hibernate.session_factory_name_is_jndi false
This is set only if the application did not specify a value for the hibernate.session_factory_name.
hibernate.ejb.entitymanager_factory_name QUALIFIED_PERSISTENCE_UNIT_NAME
This is set to the application name + persistence unit name. The application can specify a different value but it needs to be unique across all application deployments on the JBoss EAP 6 instance.
In Hibernate 4.x, if new_generator_mappings is set to true:
  • @GeneratedValue(AUTO) maps to org.hibernate.id.enhanced.SequenceStyleGenerator.
  • @GeneratedValue(TABLE) maps to org.hibernate.id.enhanced.TableGenerator.
  • @GeneratedValue(SEQUENCE) maps to org.hibernate.id.enhanced.SequenceStyleGenerator.
In Hibernate 4.x, if new_generator_mappings is set to false:
  • @GeneratedValue(AUTO) maps to Hibernate "native".
  • @GeneratedValue(TABLE) maps to org.hibernate.id.MultipleHiLoPerTableGenerator.
  • @GeneratedValue(SEQUENCE) maps to Hibernate "seqhilo".
For more information about these properties, go to http://www.hibernate.org/docs and view the Hibernate 4.1 Developer Guide.
JPA persistence properties

The following JPA properties are supported in the persistence unit definition in the persistence.xml file:

Table 3.4. JPA Persistence Unit Properties

Property Name Default Value Purpose
jboss.as.jpa.providerModule org.hibernate
The name of the persistence provider module.
The value should be hibernate3-bundled if Hibernate 3 JARs are in the application archive.
If a persistence provider is packaged with the application, this value should be application.
jboss.as.jpa.adapterModule org.jboss.as.jpa.hibernate:4
The name of the integration classes that help JBoss EAP 6 to work with the persistence provider.
Current valid values are:
  • org.jboss.as.jpa.hibernate:4: This is for the Hibernate 4 integration classes
  • org.jboss.as.jpa.hibernate:3: This is for the Hibernate 3 integration classes