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

From Eclipsepedia

Jump to: navigation, search
m (Properties)
m (Using the Package Rename Utility)
 
Line 75: Line 75:
  
 
== Using the Package Rename Utility ==
 
== Using the Package Rename Utility ==
 +
See [http://wiki.eclipse.org/EclipseLink/Examples/MigratingFromOracleTopLink#Rename_Packages Package Renamer]

Latest revision as of 15:19, 5 March 2009

This how-to discusses how a user can migrate to using EclipseLink JPA from TopLink Essentials

Contents

[edit] Persistence.xml

[edit] Persistence Provider

Modify the persistence provider from

  <provider>oracle.toplink.essentials.PersistenceProvider</provider>

or

  <provider>oracle.toplink.essentials.ejb.cmp3.EntityManagerFactoryProvider</provider>

to

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

[edit] Properties

When migrating the Persistence.xml the primary change in the persistence unit properties is converting from using "toplink.*" to "eclipselink.*"

[edit] target-server

Verify in particular that you have the eclipselink.target-server property set - especially if you are migrating from TopLink Essentials to EclipseLink - where the provider and target-server were defaulted.

  • 1) Check that your datasource is configured in transactional mode - usually the default.
  • 2) Check your persistence.xml has a target-server property - this will affect transactions.
    • Note: by default GlassFish V2 would have defaulted this "target-server" value when using TopLink Essentials because that persistence provider is the one loaded by default - When using the EclipseLink JPA provider.

You will need to specify target-server it in order to get server platform specific functionality surrounding a transaction manager acquire using "java:appserver/TransactionManager" in the SunAS9TransactionController.

    <property name="eclipselink.target-server" value="SunAS9"/>
  • 3) Other things to verify

[edit] ORM.XML

TopLink Essentials uses the JPA 1.0 defined orm.xml schema and thus is compatible with EclipseLink. The only content changes that should be made is conversion of any query hints used in the configuration.

[edit] Query Hints

[edit] Annotations

[edit] Query Hints

[edit] Java API

[edit] Query Hints

  • Java code: customer PU properties and query hints
    • Use of EclipseLink native API where TLE native API was used
  • Side-effects of the migration
    • Change from default access type when using ORM.XML

[edit] Custom Mapping Definitions

[edit] Using the Package Rename Utility

See Package Renamer