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

From Eclipsepedia

Jump to: navigation, search
(New page: == How To Migrate from OpenJPA to EclipseLink JPA == === Persistence Unit Properties === {|{{BMTableStyle}} |-{{BMTHStyle}} ! OpenJPA Property ! Description ! EclipseLink JPA Equivalent...)
 
 
(9 intermediate revisions by one user not shown)
Line 1: Line 1:
 +
__NOTOC__
 +
 
== How To Migrate from OpenJPA to EclipseLink JPA ==
 
== How To Migrate from OpenJPA to EclipseLink JPA ==
  
 +
Migrating from OpenJPA to EclipseLink JPA involves a number of standard JPA migration steps plus modification of code to handle extended functionality.
 +
 +
# [[EclipseLink/Examples/JPA/Migration/OpenJPA/PersistenceXML | Persistence.XML]] <br> ''Convert provider and persistence unit properties''
 +
# [[EclipseLink/Examples/JPA/Migration/OpenJPA/QueryHints | Query Hints]] <br> ''Convert query hint names used in named and dynamic queries''
 +
# [[EclipseLink/Examples/JPA/Migration/OpenJPA/Mappings | Mappings]] <br> ''Convert/Fix some non-standard mappings available in OpenJPA''
 +
# [[EclipseLink/Examples/JPA/Migration/OpenJPA/Extended | Extended Functionality]] <br> ''Convert from OpenJPA's extended features''
 +
 +
== Leverage EclipseLink ==
  
=== Persistence Unit Properties ===
+
After completing the conversion to EclipseLink JPA it is also very important to harness the additional features available. The most commonly used features include:
  
{|{{BMTableStyle}}
+
* Caching - ''Ensure you understand and optimize your cache configuration to work with your locking policies and the volatility of your underlying database tables''
|-{{BMTHStyle}}
+
** Shared (L2) versus Isoalted (EntityManager/TX)
! OpenJPA Property
+
** Shared type, size, and expiration/invalidation
! Description
+
** Cache coordination (where applicable)
! EclipseLink JPA Equivalent
+
* Query Optimizations - ''Minimize the amount of data loaded and cached for greater performance and optimal cache usage''
|-
+
** Batch and Joined (multi-level) for graph retrieval
| openjpa.AutoClear ||  ||
+
** Cache Usage and Refreshing
|-
+
** Data Projections for data loading on searches where full entities are not required
| openjpa.AutoDetach ||  ||
+
** Paged data/entity loading
|-
+
** Fetch Groups
| openjpa.BrokerFactory ||  ||
+
* Ensure weaving is enabled for change tracking, lazy loading, and fetch groups capabilities
|-
+
| openjpa.BrokerImpl ||  ||
+
|-
+
| openjpa.ClassResolver ||  ||
+
|-
+
| openjpa.Compatibility ||  ||
+
|-
+
| openjpa.ConnectionDriverName ||  ||
+
|-
+
| openjpa.Connection2DriverName ||  ||
+
|-
+
| openjpa.ConnectionFactory ||  ||
+
|-
+
| openjpa.ConnectionFactory2 ||  ||
+
|-
+
| openjpa.ConnectionFactoryName ||  ||
+
|-
+
| openjpa.ConnectionFactory2Name ||  ||
+
|-
+
| openjpa.ConnectionFactoryMode ||  ||
+
|-
+
| openjpa.ConnectionFactoryProperties ||  ||
+
|-
+
| openjpa.ConnectionFactory2Properties ||  ||
+
|-
+
| openjpa.ConnectionPassword ||  ||
+
|-
+
| openjpa.Connection2Password ||  ||
+
|-
+
| openjpa.ConnectionProperties ||  ||
+
|-
+
| openjpa.Connection2Properties ||  ||
+
|-
+
| openjpa.ConnectionURL ||  ||
+
|-
+
| openjpa.Connection2URL ||  ||
+
|-
+
| openjpa.ConnectionUserName ||  ||
+
|-
+
| openjpa.Connection2UserName ||  ||
+
|-
+
| openjpa.ConnectionRetainMode ||  ||
+
|-
+
| openjpa.DataCache ||  ||
+
|-
+
| openjpa.DataCacheManager ||  ||
+
|-
+
| openjpa.DataCacheTimeout ||  ||
+
|-
+
| openjpa.DetachState ||  ||
+
|-
+
| openjpa.DynamicDataStructs ||  ||
+
|-
+
| openjpa.FetchBatchSize ||  ||
+
|-
+
| openjpa.FetchGroups ||  ||
+
|-
+
| openjpa.FlushBeforeQueries ||  ||
+
|-
+
| openjpa.IgnoreChanges ||  ||
+
|-
+
| openjpa.Id ||  ||
+
|-
+
| openjpa.InverseManager ||  ||
+
|-
+
| openjpa.LockManager ||  ||
+
|-
+
| openjpa.LockTimeout ||  ||
+
|-
+
| openjpa.Log ||  ||
+
|-
+
| openjpa.ManagedRuntime ||  ||
+
|-
+
| openjpa.Mapping ||  ||
+
|-
+
| openjpa.MaxFetchDepth ||  ||
+
|-
+
| openjpa.MetaDataFactory ||  ||
+
|-
+
| openjpa.Multithreaded ||  ||
+
|-
+
| openjpa.Optimistic ||  ||
+
|-
+
| openjpa.OrphanedKeyAction ||  ||
+
|-
+
| openjpa.NontransactionalRead ||  ||
+
|-
+
| openjpa.NontransactionalWrite ||  ||
+
|-
+
| openjpa.ProxyManager ||  ||
+
|-
+
| openjpa.QueryCache ||  ||
+
|-
+
| openjpa.QueryCompilationCache ||  ||
+
|-
+
| openjpa.ReadLockLevel ||  ||
+
|-
+
| openjpa.RemoteCommitProvider ||  ||
+
|-
+
| openjpa.RestoreState ||  ||
+
|-
+
| openjpa.RetainState ||  ||
+
|-
+
| openjpa.RetryClassRegistration ||  ||
+
|-
+
| openjpa.SavepointManager ||  ||
+
|-
+
| openjpa.Sequence ||  ||
+
|-
+
| openjpa.TransactionMode ||  ||
+
|-
+
| openjpa.WriteLockLevel  ||  ||
+
|}
+

Latest revision as of 04:20, 3 November 2009


[edit] How To Migrate from OpenJPA to EclipseLink JPA

Migrating from OpenJPA to EclipseLink JPA involves a number of standard JPA migration steps plus modification of code to handle extended functionality.

  1. Persistence.XML
    Convert provider and persistence unit properties
  2. Query Hints
    Convert query hint names used in named and dynamic queries
  3. Mappings
    Convert/Fix some non-standard mappings available in OpenJPA
  4. Extended Functionality
    Convert from OpenJPA's extended features

[edit] Leverage EclipseLink

After completing the conversion to EclipseLink JPA it is also very important to harness the additional features available. The most commonly used features include:

  • Caching - Ensure you understand and optimize your cache configuration to work with your locking policies and the volatility of your underlying database tables
    • Shared (L2) versus Isoalted (EntityManager/TX)
    • Shared type, size, and expiration/invalidation
    • Cache coordination (where applicable)
  • Query Optimizations - Minimize the amount of data loaded and cached for greater performance and optimal cache usage
    • Batch and Joined (multi-level) for graph retrieval
    • Cache Usage and Refreshing
    • Data Projections for data loading on searches where full entities are not required
    • Paged data/entity loading
    • Fetch Groups
  • Ensure weaving is enabled for change tracking, lazy loading, and fetch groups capabilities