Skip to main content

Notice: this Wiki will be going read only early in 2024 and edits will no longer be possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.

Jump to: navigation, search

Difference between revisions of "EclipseLink/Examples/JPA/Migration/OpenJPA/PersistenceXML"

< EclipseLink‎ | Examples‎ | JPA‎ | Migration‎ | OpenJPA
(PU Properties)
Line 27: Line 27:
 
'' NOTE: This is complex mapping task requiring knowledge of both solutions. Not all properties will have a direct mapping.''
 
'' NOTE: This is complex mapping task requiring knowledge of both solutions. Not all properties will have a direct mapping.''
  
Please refer to the [[Using_EclipseLink_JPA_Extensions_%28ELUG%29 EclipseLink UserGuide (ELUG)]'s extended JPA functionality for a description of all supported properties or see the [http://www.eclipse.org/eclipselink/api/latest/org/eclipse/persistence/config/PersistenceUnitProperties.html PersistenceUnitProperties JavaDocs].
+
Please refer to the [[Using_EclipseLink_JPA_Extensions_%28ELUG%29 EclipseLink UserGuide (ELUG)]]'s extended JPA functionality for a description of all supported properties or see the [http://www.eclipse.org/eclipselink/api/latest/org/eclipse/persistence/config/PersistenceUnitProperties.html PersistenceUnitProperties JavaDocs].
 +
 
 +
==== JDBC Properties ====
 +
 
 +
These properties are used to configure internal connection pooling typically used in JavaSE or containers where data sources are not available.
  
 
{|{{BMTableStyle}}
 
{|{{BMTableStyle}}
Line 35: Line 39:
 
! EclipseLink JPA Equivalent
 
! EclipseLink JPA Equivalent
 
|-
 
|-
| openjpa.AutoClear ||  ||  
+
| openjpa.ConnectionDriverName ||  || EclipseLink 1.0-1.1.x: eclipselink.jdbc.driver <br> EclipseLink 1.2+: javax.persistence.jdbc.driver
 
|-
 
|-
| openjpa.AutoDetach ||  ||
+
| openjpa.ConnectionPassword ||  || EclipseLink 1.0-1.1.x: eclipselink.jdbc.password <br> EclipseLink 1.2+: javax.persistence.jdbc.password
 
|-
 
|-
| openjpa.BrokerFactory ||  ||
+
| openjpa.ConnectionURL ||  || EclipseLink 1.0-1.1.x: eclipselink.jdbc.url <br> EclipseLink 1.2+: javax.persistence.jdbc.url
 
|-
 
|-
| openjpa.BrokerImpl ||  ||
+
| openjpa.ConnectionUserName ||  || EclipseLink 1.0-1.1.x: eclipselink.jdbc.user <br> EclipseLink 1.2+: javax.persistence.jdbc.user
 
|-
 
|-
| openjpa.ClassResolver ||  ||
+
| openjpa.ConnectionProperties ||  ||
|-
+
| openjpa.Compatibility ||  ||
+
|-
+
| openjpa.ConnectionDriverName ||  || eclipselink.jdbc.driver
+
 
|-
 
|-
 
| openjpa.ConnectionFactory ||  ||
 
| openjpa.ConnectionFactory ||  ||
Line 56: Line 56:
 
|-
 
|-
 
| openjpa.ConnectionFactoryProperties ||  ||
 
| openjpa.ConnectionFactoryProperties ||  ||
|-
 
| openjpa.ConnectionPassword ||  || eclipselink.jdbc.password
 
|-
 
| openjpa.ConnectionProperties ||  ||
 
|-
 
| openjpa.ConnectionURL ||  || eclipselink.jdbc.url
 
|-
 
| openjpa.ConnectionUserName ||  || eclipselink.jdbc.user
 
 
|-
 
|-
 
| openjpa.Connection2DriverName ||  ||
 
| openjpa.Connection2DriverName ||  ||
Line 82: Line 74:
 
|-  
 
|-  
 
| openjpa.ConnectionRetainMode ||  ||
 
| openjpa.ConnectionRetainMode ||  ||
 +
|}
 +
 +
==== Diagnostic Properties ====
 +
 +
{|{{BMTableStyle}}
 +
|-{{BMTHStyle}}
 +
! OpenJPA Property
 +
! Description
 +
! EclipseLink JPA Equivalent
 +
| openjpa.Log || Possible values: openjpa, commons, log4j, none  || [[Using_EclipseLink_JPA_Extensions_(ELUG)#Using_EclipseLink_JPA_Extensions_for_Logging | eclipselink.logging.logger]] with values DefaultLogger, JavaLogger, ServerLogger, or custom
 +
|}
 +
 +
==== Caching Properties ====
 +
 +
{|{{BMTableStyle}}
 +
|-{{BMTHStyle}}
 +
! OpenJPA Property
 +
! Description
 +
! EclipseLink JPA Equivalent
 +
|-
 +
| openjpa.AutoClear ||  ||
 +
|-
 +
| openjpa.AutoDetach ||  ||
 
|-
 
|-
 
| openjpa.DataCache ||  ||
 
| openjpa.DataCache ||  ||
Line 88: Line 103:
 
|-
 
|-
 
| openjpa.DataCacheTimeout ||  ||
 
| openjpa.DataCacheTimeout ||  ||
 +
|-
 +
| openjpa.DetachState ||  ||
 +
|-
 +
| openjpa.FlushBeforeQueries ||  ||
 +
|-
 +
| openjpa.QueryCache ||  ||
 +
|-
 +
| openjpa.QueryCompilationCache ||  ||
 +
|}
 +
 +
==== Other Properties ====
 +
 +
{|{{BMTableStyle}}
 +
|-{{BMTHStyle}}
 +
! OpenJPA Property
 +
! Description
 +
! EclipseLink JPA Equivalent
 +
|-
 +
| openjpa.BrokerFactory ||  ||
 +
|-
 +
| openjpa.BrokerImpl ||  ||
 +
|-
 +
| openjpa.ClassResolver ||  ||
 +
|-
 +
| openjpa.Compatibility ||  ||
 
|-
 
|-
 
| openjpa.DetachState ||  ||
 
| openjpa.DetachState ||  ||
Line 108: Line 148:
 
|-
 
|-
 
| openjpa.LockTimeout ||  ||
 
| openjpa.LockTimeout ||  ||
|-
 
| openjpa.Log || Possible values: openjpa, commons, log4j, none  || [[Using_EclipseLink_JPA_Extensions_(ELUG)#Using_EclipseLink_JPA_Extensions_for_Logging | eclipselink.logging.logger]] with values DefaultLogger, JavaLogger, ServerLogger, or custom
 
 
|-
 
|-
 
| openjpa.ManagedRuntime ||  ||
 
| openjpa.ManagedRuntime ||  ||
Line 130: Line 168:
 
|-
 
|-
 
| openjpa.ProxyManager ||  ||
 
| openjpa.ProxyManager ||  ||
|-
 
| openjpa.QueryCache ||  ||
 
|-
 
| openjpa.QueryCompilationCache ||  ||
 
|-
 
| openjpa.ReadLockLevel ||  ||
 
 
|-
 
|-
 
| openjpa.RemoteCommitProvider ||  ||
 
| openjpa.RemoteCommitProvider ||  ||

Revision as of 04:48, 3 November 2009

Migration from OpenJPA to EclipseLink: Persistence XML

NOTE: Under Construction

When migrating it is important to first address the changes required in the persistence.XML file. If you encounter any migration issues in the persistence.xml file not covered here or incomplete please log a documentation enhancement request referencing this page and describe your migration challenge.

Provider

The JPA persistence provider typically needs to be set during any migration to ensure the EclipseLink JPA provider is used in case multiple providers exist in the target container.

<provider>org.eclipse.persistence.jpa.PersistenceProvider</provider>

JavaSE USage

It has been reported that in JavaSE usage of OpenJPA the provider resolver functionality may continue to use OpenJPA if it is encountered first on the classpath and ignore the specified <provider>. If this is encountered the best solution is to remove OpenJPA from the classpath of your application or test harness.

PU Properties

Persistence Unit properties are a standard mechanism for providing vendor specific configuration. They are most common used to handle the configuration of:

  • JDBC pooling
  • Cache configuration and usage

The following table captures the OpneJPA persistence unit properties and their corresponding EclipseLink JPA properties.

NOTE: This is complex mapping task requiring knowledge of both solutions. Not all properties will have a direct mapping.

Please refer to the Using_EclipseLink_JPA_Extensions_(ELUG) EclipseLink UserGuide (ELUG)'s extended JPA functionality for a description of all supported properties or see the PersistenceUnitProperties JavaDocs.

JDBC Properties

These properties are used to configure internal connection pooling typically used in JavaSE or containers where data sources are not available.

OpenJPA Property Description EclipseLink JPA Equivalent
openjpa.ConnectionDriverName EclipseLink 1.0-1.1.x: eclipselink.jdbc.driver
EclipseLink 1.2+: javax.persistence.jdbc.driver
openjpa.ConnectionPassword EclipseLink 1.0-1.1.x: eclipselink.jdbc.password
EclipseLink 1.2+: javax.persistence.jdbc.password
openjpa.ConnectionURL EclipseLink 1.0-1.1.x: eclipselink.jdbc.url
EclipseLink 1.2+: javax.persistence.jdbc.url
openjpa.ConnectionUserName EclipseLink 1.0-1.1.x: eclipselink.jdbc.user
EclipseLink 1.2+: javax.persistence.jdbc.user
openjpa.ConnectionProperties
openjpa.ConnectionFactory
openjpa.ConnectionFactoryName
openjpa.ConnectionFactoryMode
openjpa.ConnectionFactoryProperties
openjpa.Connection2DriverName
openjpa.Connection2Properties
openjpa.ConnectionFactory2Name
openjpa.ConnectionFactory2
openjpa.ConnectionFactory2Properties
openjpa.Connection2Password
openjpa.Connection2UserName
openjpa.Connection2URL
openjpa.ConnectionRetainMode

Diagnostic Properties

OpenJPA Property Description EclipseLink JPA Equivalent openjpa.Log Possible values: openjpa, commons, log4j, none eclipselink.logging.logger with values DefaultLogger, JavaLogger, ServerLogger, or custom

Caching Properties

OpenJPA Property Description EclipseLink JPA Equivalent
openjpa.AutoClear
openjpa.AutoDetach
openjpa.DataCache
openjpa.DataCacheManager
openjpa.DataCacheTimeout
openjpa.DetachState
openjpa.FlushBeforeQueries
openjpa.QueryCache
openjpa.QueryCompilationCache

Other Properties

OpenJPA Property Description EclipseLink JPA Equivalent
openjpa.BrokerFactory
openjpa.BrokerImpl
openjpa.ClassResolver
openjpa.Compatibility
openjpa.DetachState
openjpa.DynamicDataStructs
openjpa.FetchBatchSize
openjpa.FetchGroups
openjpa.FlushBeforeQueries
openjpa.IgnoreChanges
openjpa.Id
openjpa.InverseManager
openjpa.LockManager
openjpa.LockTimeout
openjpa.ManagedRuntime
openjpa.Mapping
openjpa.MaxFetchDepth
openjpa.MetaDataFactory
openjpa.Multithreaded
openjpa.Optimistic
openjpa.OrphanedKeyAction
openjpa.NontransactionalRead
openjpa.NontransactionalWrite
openjpa.ProxyManager
openjpa.RemoteCommitProvider
openjpa.RestoreState
openjpa.RetainState
openjpa.RetryClassRegistration
openjpa.SavepointManager
openjpa.Sequence
openjpa.TransactionMode
openjpa.WriteLockLevel

Back to the top