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/OracleTopLinkNative"

m (xref for 278216)
m
 
(One intermediate revision by the same user not shown)
Line 1: Line 1:
==Migrating from Oracle TopLink to EclipseLink==
+
'''[[Image:Elug_draft_icon.png|Warning]] This page is obsolete. Please see "Migrating from Native TopLink to EclipseLink" in the ''[http://www.eclipse.org/eclipselink/documentation/2.4/solutions/migrnativetoplink.htm EclipseLink Solutions Guide]'' for current information.'''
 
+
This article will give an overview of how to migrate an Oracle TopLink project to EclipseLink
+
 
+
===Replace Deprecated Oracle TopLink API===
+
API that has been deprecated in Oracle TopLink has been removed from EclipseLink. If your code uses any deprecated TopLink API, you must update the code to the API recommended in the deprecation comment.
+
 
+
Refer to the [http://www.oracle.com/technology/products/ias/toplink/doc/11110/api/api_mod_readme.html Oracle TopLink API Modification Guide] for a complete list of deprecated API, including recommended replacements.
+
 
+
===Rename Packages===
+
The base package in Oracle TopLink has been renamed from '''oracle.toplink''' to '''org.eclipse.persistence'''. In addition, some lower level packages have also been refactored.
+
 
+
To facilitate moving to these new package names, a '''package renamer''' tool is included with the EclipseLink installation. This package renamer will replace the old Oracle TopLink package names with the new EclipseLink names. You should use this tool on your:
+
*project source code
+
*project.xml file
+
*persistence.xml file
+
*sessions.xml file
+
 
+
The package renamer is located in the <tt>eclipselink\utils\rename</tt> directory and includes both a JAR file and some scripts.
+
The <tt>utilities.MigrateTopLinkToEclipseLink</tt> class contains the main method that runs the package renamer. The project does not have any external dependencies.
+
 
+
 
+
 
+
====Running the Package Renamer====
+
To run the package renamer using the scripts:
+
<ol>
+
<li>Unzip the '''eclipselink-installer.zip''' from the base of the SVN structure and find the scripts in the bin directory.</li>
+
<li>Run either '''packageRename.cmd''' or '''packageRename.sh''' (both located in the <tt><INSTALL_DIRECTORY>/utils/rename</tt> directory) with two arguments:
+
*'''sourceLocation''' - The directory that contains the files to rename.
+
*'''targetLocation''' - The destination directory. The package renamer will remove any existing Java and XML files; in most cases you may want to specify an empty directory.
+
<br>
+
For example:
+
<div class="example">
+
packageRename c:/mySourceLocation c:/myDestinationLocation
+
</div>
+
</li>
+
</ol>
+
The package renamer performs a recursive directory search for Java and XML files to rename. The renamed version of each file is saved in the corresponding 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 persistence 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.
+
 
+
Review the [[Using_EclipseLink_JPA_Extensions_(ELUG)#What_You_May_Need_to_Know_About_Using_EclipseLink_JPA_Persistence_Unit_Properties|What You May Need to Know About Using EclipseLink JPA Persistence Unit Properties]] section of the ''EclipseLink User Guide'' for additional information when migrating to EclipseLink.
+
 
+
====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
+
 
+
 
+
===TopLink Workbench===
+
 
+
To convert your TopLink Workbench (<tt>.mwp</tt>) project to an EclipseLink Workbench project:
+
# Use the package renamer (as detailed above) to migrate your TopLink Workbench project source.
+
# Open the TopLink Workbench project with EclipseLink Workbench.
+
# EclipseLink Workbench detects the project and displays the following message:<br />[[Image:Tlw_elb_project_dialog.png]]
+
# Click '''Save Now''' and select a new directory location in which to save the EclipseLink project.
+

Latest revision as of 12:51, 30 January 2013

Warning This page is obsolete. Please see "Migrating from Native TopLink to EclipseLink" in the EclipseLink Solutions Guide for current information.

Back to the top