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 "Teneo/EclipseLink"

(Generating the orm.xml through the menu)
(Generating the orm.xml through the menu)
Line 54: Line 54:
  
  
[[Image:ORMDependency.png center]]
+
[[Image:ORMDependency.png] center]
  
  
Line 60: Line 60:
  
  
[[Image:ORMResult.png center]]
+
[[Image:ORMResult.png] center]
  
 
The above logic assumes that the ecore file is present in the same Java project as the generated model code.
 
The above logic assumes that the ecore file is present in the same Java project as the generated model code.
  
 
== Generating the orm.xml programmatically ==
 
== Generating the orm.xml programmatically ==

Revision as of 16:36, 29 March 2009

Introduction

Teneo provides integration with EclipseLink JPA to support persistence of arbitrary EMF models with JPA. The original goal of this integration was to allow developers to map EMF generated classes with standard JPA. In future, model driven development will be supported to generate the classes, JPA mappings, and database schema from an EMF model.

Under Construction

Getting Started with Teneo-EclipseLink in Eclipse 3.4 (Ganymede)

1. Download EclipseLink packaged as OSGi Bundles

2. Place all the bundles into <ECLIPSE_HOME>/dropins. Make sure they are directly in dropins or they won't be found. The download zip file may have all the bundles in "plugins".

3. Until we get downloadble zips available you'll have to checkout the following projects from Teneo CVS dev.eclipse.org:/cvsroot/modeling/org.eclipse.emf/org.eclipse.emf/teneo

examples/
org.eclipse.emf.teneo.eclipselink.examples.derby
org.eclipse.emf.teneo.eclipselink.examples.library
org.eclipse.emf.teneo.eclipselink.examples.library.edit
org.eclipse.emf.teneo.eclipselink.examples.library.editor
org.eclipse.emf.teneo.eclipselink.examples.library.orm
plugins/
org.eclipse.emf.teneo.eclipselink
org.eclipse.emf.teneo.eclipselink.common
org.eclipse.emf.teneo.eclipselink.common.ui
org.eclipse.emf.teneo.eclipselink.elistfactory
org.eclipse.emf.teneo.eclipselink.ui
tests/
org.eclipse.emf.teneo.eclipselink.examples.library.orm.tests
org.eclipse.emf.teneo.eclipselink.elistfactory.tests
org.eclipse.emf.teneo.eclipselink.tests


You will see a compilation error on org.eclipse.emf.teneo.eclipselink.examples.derby--Don't Panic. This is expected. See the ReadMe.txt for details.

4. Setup the Database The examples are built to run against Apache Derby.

  • You'll need to download the latest release of Derby from apache.org and startup the network server by running <DERBY_HOME>/bin/startNetworkServer[.bat] (at least this is path in Derby 10.3.2.1).
  • Define DERBY_HOME in your environment and then start, or restart Eclipse. See the Derby plugin ReadMe.txt for details.


Generating the orm.xml from the model

To support a top-to-bottom mapping approach Teneo makes it possible to generate the orm.xml from the ecore model. There are two ways to generate the orm.xml:

  1. By right-clicking the ecore file and selecting the submenu Teneo > Generate orm. See below for a full description.
  2. Programmatically by instantiating the org.eclipse.emf.teneo.jpa.convert.ORMGenerator class and calling a specific method on the class.

Generating the orm.xml through the menu

To generate the orm.xml through the menu the following has to be setup/done:

  • generate the model code (standard EMF action)
  • add the following two dependencies to the model project, open the MANIFEST.MF file in the model project's META-INF directory and go to the dependency tab. Then add the following two dependencies:
    • org.apache.commons.logging
    • org.eclipse.emf.teneo.orm


[[Image:ORMDependency.png] center]


  • right-click on the ecore file and choose the Teneo > Generate orm submenu. The system now generates an orm.xml file in the same folder as the ecore file.


[[Image:ORMResult.png] center]

The above logic assumes that the ecore file is present in the same Java project as the generated model code.

Generating the orm.xml programmatically

Back to the top