Step 1: Environment Setup
Add runtime plugin to dependencies of plugin.xml
To enable the runtime layer the org.eclipse.emf.teneo.hibernate plugin needs to be added to the plugin dependencies of the plugin.xml (see image below). The org.eclipse.emf.teneo.hibernate plugin should be re-exported.
Your database JDBC driver should be added to classpath of the plugin and possible the packages of the jdbc driver have to be made visible to other plugins.
Also add the plugin with Hibernate libraries to the dependencies (with reexport=true) or add the hibernate libraries to the model project and make the packages visible.
Create Empty Database
The runtime layer will automatically create tables and foreign constraints, i.e. the hibernate.hbm2dll_auto is set automatically to update if not set by the user. 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: library.
Add Logging
To view the log messages of Hibernate and Teneo 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. In addition you have to set in the build.properties (build tab in the manifest.mf editor) that the log4j.properties file is included in the binary build.
Please click here to go to the next step to create a library object and store it.