Teneo/Hibernate/Download and Install
The installation method for Teneo depends on the target environment(Eclipse/OSGI or web container). Both cases are discussed on this page. This page also describes where to find the example projects used in the tutorials in the wiki.
Teneo is build and tested on Eclipse 3.5 (Teneo 1.1.*) and Eclipse 3.6 (Teneo 1.2.*). This page assumes that you have a running Eclipse 3.5/3.6 instance available.
To run Teneo you need the following software:
- EMF 2.5 (Teneo 1.1.*) or 2.6 (Teneo 1.2.*)
- Hibernate 3.6.0 and its dependencies
- Apache commons logging
- JDBC driver
Some dependencies can not be downloaded from eclipse.org because of licensing differences. Teneo provides an update site with the required dependencies: http://www.elver.org/eclipse/update.
Download and install using the update manager (for usage in Eclipse/OSGI)
NOTE: CDO Hibernate Store users should use the Teneo 1.1.2/Hibernate 3.3.2 version (see update site below).
To download and install Teneo and its dependencies, use the following update sites:
- EMF 2.5: http://download.eclipse.org/modeling/emf/updates/releases/ (this site also lists Teneo builds, but is better to use a recent maintenance build, see the interim site below)
- EMF 2.6: http://download.eclipse.org/modeling/emf/updates/interim/
- Teneo: http://download.eclipse.org/modeling/emf/teneo/updates/1.2.0/interim/
- Hibernate and other dependencies: http://www.elver.org/eclipse/update
For an older release of Teneo supporting Hibernate versions 3.3.2 to 3.5.x:
- Teneo: http://download.eclipse.org/modeling/emf/teneo/updates/1.1.2/interim/
- Hibernate and other dependencies: http://www.elver.org/eclipse/update_1.1.2
The EMF update site, select the EMF/XSD SDK:
The Teneo update site will look similar to this image. Select the Teneo Hibernate SDK:
The elver update site lists the Hibernate, dom4j and a number of JDBC plugins (select them all):
Creating your own Hibernate plugin
If you want to make your own Hibernate/library plugin there is one specific setting which needs to be set in your plugin: make sure to add the following line to the MANIFEST.MF of the Hibernate/libraries plugin you create:
This is required otherwise the Hibernate libraries can not find your model classes when performing runtime class enhancement. See here for more information. Note that also other Eclipse-BuddyPolicy settings can be used (and can make sense in production environments) but the 'dependent' setting is the safest one.
Install Teneo for use within a Web Container
For usage within a web container the following jar files are required. You can download these files from the plugins section on the update site using your web browser:
- EMF jar files:
- Teneo jar files:
- Dependencies: it is probably best to download hibernate, commons-logging and a jdbc driver directly from their respective websites. You can however also find these jar files in the eclipse/plugins directory after installing the Teneo dependencies through the update manager.
For a web container these jar files should be placed in the WEB-INF/lib directory of your web application.
Download Example Project for Tutorials
The example project (org.eclipse.emf.teneo.hibernate.examples) can be found on this cvs location:
The main examples project used in the tutorials is the: org.eclipse.emf.teneo.hibernate.examples project.
This example project uses an extended version of the well-known EMF library example. The example project contains the generated model code and a number of tutorial classes showing how to work with EMF, Teneo and Hibernate.
Some more details regarding the example project. The example project consists of the following:
- an ecore model and genmodel (in the model subfolder)
- generated model code (no manual changes done, so you can change the ecore model and regenerate the code)
- a number of tutorial java classes in the org.eclipse.emf.teneo.hibernate.examples package
The MANIFEST.MF of the examples project lists dependencies on several plugins, see the next section for more information on this.
Teneo, import-packages and ClassNotFoundException when running junit testcases
The Teneo and Hibernate plugins declare dependencies using import-packages. When running junit testcases as normal Java applications or standard junit tests then there is no OSGI environment which takes care of resolving these import-packages. This means that the import-package dependencies are not resolved and ClassNotFoundExceptions are thrown.
This can be solved by explicitly declaring the dependency in the MANIFEST.MF of your test or model project. As an example: these are the dependendencies set in the examples project:
Require-Bundle: org.eclipse.core.runtime, org.eclipse.emf.ecore;visibility:=reexport, org.eclipse.emf.ecore.xmi;visibility:=reexport, org.eclipse.emf.teneo.hibernate;bundle-version="1.1.2", org.hibernate;bundle-version="3.3.2", org.eclipse.emf.ecore.change, org.apache.commons.logging, org.dom4j, org.hsqldb, com.mysql.jdbc