EclipseLink/Examples/JPA/Migration/OpenJPA
< EclipseLink | Examples | JPA | Migration
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.
- Persistence.XML
Convert provider and persistence unit properties - Query Hints
Convert query hint names used in named and dynamic queries - Mappings
Convert/Fix some non-standard mappings available in OpenJPA - Extended Functionality
Convert from OpenJPA's extended features - 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.
- Column Types
Differences related to column types