Step 1: Generate jdo, enhance classes
- Enable JPOX Support
- Add runtime plugin to dependencies of plugin.xml
- Generate OR Mapping
- Create Empty Database
- Add Logging
Enable JPOX Support
This tutorial assumes that the JPOX Eclipse pluging has been installed. Perform the following steps to enable JPOX support (see the image below):
- Add JPOX support: right click on the library project and in the JPOX menu choose Add JPOX Support
- Enable Auto Enhancement: this automatically enhances your classes after each Eclipse build, right click on the library project and in the JPOX menu check Enable Auto-Enhancement

Add runtime plugin to dependencies of plugin.xml
To enable the runtime layer the org.eclipse.emf.teneo.jpox plugin and the plugin with the jpox libraries needs to be added to the plugin dependencies of the plugin.xml (see image below).
In addition your database JDBC driver should be added to classpath of the plugin (or just add it to the jpox libraries plugin which you created).

The runtime plugin needs to be specified in the plugin dependencies before the OR mapping can be generated.
Generate OR Mapping
To generate the OR mapping right click on the ecore file and select the option Generate EMF - JDO/JPOX OR Mapping in the Teneo submenu (the exact label of this menu option may vary depending on the Teneo release you use). The generation takes only a second, the package.jdo file should be created in the same folder as the ecore file. It is possible that the folder needs to be refreshed manually.
Next copy the created package.jdo file to a location in the source tree and build the project (if it is not done automatically).
Note:
- The OR Mapper searches for the EPackage classes in your project and uses the classpath of the project of the ecore file.
- The only requirement is that your EPackage classes (the interface) extend the emf EPackage interface directly.
- If there was already a package jdo file at the location, then the old version is copied to package.jdo_old
- The JPOX enhancer automatically enhances your class files if you have automatic build on, see the console view for the output of the enhancer

The or mapping can also be generated programmatically, see here.
Create Empty Database
The runtime layer will automatically create tables and foreign constraints. However it will not automatically create a database. For this tutorial you need to manually create an empty database in your database server, the database should have the name: mylibrary.
Add Logging
To view the log messages of JPOX and the integration layer you have to set the log4j properties. A simple sample log4j.properties file can be downloaded here. The log4j.properties file has to be placed directly in the src folder of the library model project.
Please click here to go to the next step to create a library object and store it.