Notice: This Wiki is now read only and edits are no longer possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.
Difference between revisions of "EclipseLink/Examples/JPA/Migration/OracleTopLinkNative"
Line 11: | Line 11: | ||
The base package has been renamed from "oracle.toplink" to "org.eclipse.persistence". Some lower level packages have also been refactored. To cope with this issue and package rename tool is included in the intstall. This package renamed replaces package and class references with the updated ones. You should run the tool on your source code, project xml, persistence.xml and sessions.xml | The base package has been renamed from "oracle.toplink" to "org.eclipse.persistence". Some lower level packages have also been refactored. To cope with this issue and package rename tool is included in the intstall. This package renamed replaces package and class references with the updated ones. You should run the tool on your source code, project xml, persistence.xml and sessions.xml | ||
− | |||
− | The package renamer can be found in foundation/eclipselink.util/rename-utility. That directory contains both a jar and an EclipseLink project. It can be run from either of those, or from the scripts included in the installer. | + | The package renamer can be found in foundation/eclipselink.util/rename-utility. That directory contains both a jar and an EclipseLink project. It can be run from either of those, or from the scripts included in the installer. The utilities.MigrateTopLinkToEclipseLink class contains the main method that runs the renamer. The project does not have any external dependancies. |
− | + | ====Running the Package Renamer==== | |
+ | To run the renamer using the scripts: | ||
+ | * Unzip the eclipselink-installer-incubation.zip from the base of the SVN structure and find the scripts in the bin directory | ||
* run either packageRename.cmd or packageRename.sh located in the install's bin directory with two arguments - sourceLocation and targetLocation | * run either packageRename.cmd or packageRename.sh located in the install's bin directory with two arguments - sourceLocation and targetLocation | ||
** e.g. packageRename c:/mySourceLocation c:/myDestinationLocation | ** e.g. packageRename c:/mySourceLocation c:/myDestinationLocation |
Revision as of 11:23, 26 October 2007
Contents
Migrating from Oracle TopLink to EclipseLink
This article will give an overview of how to migrate an Oracle TopLink project to EclipseLink
Deprecated Oracle TopLink API
API that has been deprecated in Oracle TopLink will be removed from EclispeLink. If your code makes use of any deprecated TopLink API, you will have to update it to use the API recommended in the deprecation comment.
Rename Packages
The base package has been renamed from "oracle.toplink" to "org.eclipse.persistence". Some lower level packages have also been refactored. To cope with this issue and package rename tool is included in the intstall. This package renamed replaces package and class references with the updated ones. You should run the tool on your source code, project xml, persistence.xml and sessions.xml
The package renamer can be found in foundation/eclipselink.util/rename-utility. That directory contains both a jar and an EclipseLink project. It can be run from either of those, or from the scripts included in the installer. The utilities.MigrateTopLinkToEclipseLink class contains the main method that runs the renamer. The project does not have any external dependancies.
Running the Package Renamer
To run the renamer using the scripts:
- Unzip the eclipselink-installer-incubation.zip from the base of the SVN structure and find the scripts in the bin directory
- run either packageRename.cmd or packageRename.sh located in the install's bin directory with two arguments - sourceLocation and targetLocation
- e.g. packageRename c:/mySourceLocation c:/myDestinationLocation
- sourceLocation should be a directory containing files you would like to rename.
- targetLocation is the destination directory. Note: the package renamer will remove existing java and xml files so in most cases you will want to specify an empty directory
- The package renamer does a recursive directory search for java and xml files to rename and puts the renamed version in the cooresponding directory in the targetLocation.
Dealing with XML Configuration files
The package renamer is capable of renaming our XML configuration files, but depending on the type of file, you may need to make additional changes or have other options.
Sessions XML
Sessions XML files from Oracle TopLink 11 can be read by EclipseLink. You can continue to use those files or for a more forward compatible solution, run the renamer on your sessions xml files.
Deployment XML
Deployment XML files from Oracle TopLink 10.1.3 and above can be read by EclipseLink. You can continue to use those files or for a more forward compatible solution, run the renamer on these files and replace the version string in the XML Header with the following:
"Eclipse Persistence Services"
Persistence XML
In order to use EclipseLink as a persitence provider you will have to run the renamer on your persistence.xml files. The renamer will update the persistence provider to the EclipseLink persistence provider and also update any Oracle TopLink specific properties to the EclipseLink equivalent.
ORM XML
ORM XML is non-TopLink dependant and does not need to be updated.
TopLink Essentials
The above process will also work for TopLink Essentials projects