Download and Install
- EMF Installation
- EMF - JPOX Persistency Plugin Installation
- JPOX Libraries
- JPOX - Eclipse Enhancement Tool
- Using the EMF - JPOX Runtime plugin
EMF Installation
EMF can be installed in Eclipse using the Eclipse update manager. See here for more information. It is best to install the EMF SDK 2.3.* which contains the complete bundle with emf, xsd and sdo.
EMF - JPOX Persistency Plugin Installation
The EMF - JPOX Persistency plugin can be downloaded from the eclipse.org/emf update site. To configure this update site in Eclipse go to: Help > Software Updates > Find and Install. Select 'Search for new features to install' and click next.
At this window create a new update site by clicking on 'New Remote Site'. Enter any name you want, as a url enter: http://download.eclipse.org/modeling/emf/updates/interim/, and press ok.
Select the newly created update site and press finish. When the update site contents are shown, select the Teneo EMF - JPOX Persistency (possibly followed by version information) Feature.
The feature consists of a number of plugins: org.eclipse.emf.teneo.jpox.eclipse and org.eclipse.emf.teneo.jpox. The first plugin contains the OR Mapper which generates jdo descriptor files. The second plugin contains the jar files for the EMF - JPOX persistency runtime.
After you have installed the plugin and restarted eclipse you will see a new menu entry called Teneo when you right click on an ecore file.
Note, if you have a earlier version of the EMF - JPOX persistency plugin installed then you it is possible that you need to manually disable the previous version of the EMF - JPOX feature, see here.
JPOX Libraries
The EMF - JPOX persistency feature does not contain the JPOX libraries (and its dependencies). Please download the JPOX libraries separately from: the JPOX website. The JPOX dependencies are listed: here.
A common approach is to place the JPOX libraries in a separate plugin on which your model plugin will depend. If you do this then you should also set the BuddyPolicy in the plugin containing the JPOX jars (in the Manifest.MF), for example: Eclipse-BuddyPolicy: dependent.
JPOX - Eclipse Enhancement Tool
JPOX delivers a plugin to automatically enhance class files after a package.jdo has been generated. This jpox - eclipse plugin can be downloaded from the jpox website here or through the jpox update site (http://www.jpox.org/downloads/eclipse-update). After installing the jpox plugin, restart Eclipse.
Using the EMF - JPOX Runtime plugin
The installed runtime plugin (org.eclipse.emf.teneo.jpox) can be used in two ways: 1) in an EMF model plugin, 2) in a non-plugin project.
Using the runtime plugin in an EMF model plugin
To use the runtime plugin in an EMF model plugin go through the following steps (in this order):
- In the plugin.xml, dependency tab, of the EMF model plugin project add a dependency to the EMF - JPOX persistency plugin (org.eclipse.emf.teneo.jpox). Set the properties of this dependency to re-export.
- Add a dependency from the model project to the plugin with jpox jar files and check the re-export property of this dependency.
- Right click on the EMF model project and in the JPOX menu choose 'Add JPOX Support'. Next check 'Enable Auto-Enhancement' in the same JPOX menu
- Add a JDBC driver to the EMF editor (or the model) plugin project (if not already present in the JPOX library plugin)
Note: see here if you get the following message in the problem view: build path contains duplicate entry: .....
Using the runtime layer in a non-plugin EMF project
In case of a non-plugin project the jar files present in the following plugins need to be added to the classpath (in addition to the jpox jars):
- org.eclipse.emf.teneo
- org.eclipse.emf.teneo.annotations
- org.eclipse.emf.teneo.jpox (note: there are two jar files in this plugin, both are required)
In addition a jdbc driver should be added to the classpath.