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"

m (Differences between OpenJPA and EclipseLink)
 
(5 intermediate revisions by 3 users not shown)
Line 1: Line 1:
 +
__NOTOC__
 +
 
== How To Migrate from OpenJPA to EclipseLink JPA ==
 
== How To Migrate from OpenJPA to EclipseLink JPA ==
  
Line 6: Line 8:
 
# [[EclipseLink/Examples/JPA/Migration/OpenJPA/QueryHints | Query Hints]] <br> ''Convert query hint names used in named and dynamic queries''
 
# [[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/Mappings | Mappings]] <br> ''Convert/Fix some non-standard mappings available in OpenJPA''
# Extended Functionality <br> ''Convert from OpenJPA's extended features''
+
# [[EclipseLink/Examples/JPA/Migration/OpenJPA/Extended | Extended Functionality]] <br> ''Convert from OpenJPA's extended features''
# Leverage EclipseLink's Advanced Capabilities
+
# [[EclipseLink/Examples/JPA/Migration/OpenJPA/JPQL | JPQL syntax]] <br> ''Convert JPQL syntax''
  
== Convert Extended Functionality ==
+
== Leverage EclipseLink ==
  
OpenJPA does offer some features that go beyond the JPA specification the following sections describe these features and how you migrate to the corresponding functionality in 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:
  
* BigCollection
+
* Caching - ''Ensure you understand and optimize your cache configuration to work with your locking policies and the volatility of your underlying database tables''
* FetchPlan/Group
+
** Shared (L2) versus Isoalted (EntityManager/TX)
* Inheritance Casting
+
** Shared type, size, and expiration/invalidation
* Native SQL with POJO results
+
** Cache coordination (where applicable)
* Detached (Serialized) entities & relationships
+
* 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
  
== Leverage EclipseLink ==
+
== Differences between OpenJPA and EclipseLink ==
 +
 
 +
There are a number of differences in behavior between OpenJPA and EclipseLink that are important to be aware of when migrating.
 +
 
 +
# [[EclipseLink/Examples/JPA/Migration/OpenJPA/ColumnTypes | Column Types]] <br> ''Differences related to column types''

Latest revision as of 16:09, 9 June 2016


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
  5. JPQL syntax
    Convert JPQL syntax

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

Differences between OpenJPA and EclipseLink

There are a number of differences in behavior between OpenJPA and EclipseLink that are important to be aware of when migrating.

  1. Column Types
    Differences related to column types

Back to the top