HomeEMF HibernateEMF JDO/JPOXWeb App GenerationServices
 

Tutorial: Using Teneo Hibernate in a Graphical Framework Editor

This tutorial describes how the generated GMF editor can be adapted to operate on a relational database. Both the diagram data and the model data will be stored in the same relational database.

From the GMF website:

The Eclipse Graphical Modeling Framework (GMF) provides a generative component and runtime infrastructure for developing graphical editors based on EMF and GEF. The project aims to provide these components, in addition to exemplary tools for select domain models which illustrate its capabilities.

This tutorial shows you how to adapt the plugins from the Mindmap tutorial to operate on a relational database using hibernate. The chosen approach is to make very small changes to the generated code and is not necessarily focused on an elegant or optimal solution.

The result of this tutorial will be a displayed as a menu option in Eclipse which directly opens the editor on a relational database.

Diagram

Assumptions:

  • The latest Teneo plugins have been installed (see here ).
  • The Hibernate libraries and jdbc driver library should be present in a separate plugin. The Eclipse-Buddypolicy of this Hibernate plugin has to be set to: dependent (see here ).
  • You have done part 1 of the Mindmap tutorial described here . This tutorial builds further on the mindmap example.
  • This tutorial uses mysql as an example, as a prerequisite you need to create an empty database in your database with the name mindmap.

The result of this tutorial can be downloaded from cvs: Host: dev.eclipse.org, path: /cvsroot/modeling and module org.eclipse.emf/org.eclipse.emf.teneo/examples/gmf/. The projects in cvs assume that the hibernate library project is called Hibernate Libraries.

The next step of this tutorial describes the setup in more detail.