HomeEMF HibernateEMF JDO/JPOXWeb App GenerationServices
 

Resource Utility: directly open an editor, import/export

As part of the EMF Hibernate plugin install a separate utility is also installed. This utility can be used to directly open a relational Hibernate database in the generated EMF editor.

This resource utility is in many ways very basic. It may or may not be usefull for you and will be extended in the future.

The ehb file

The resource utility operates on files with the extension ehb. This file contains registration and database connection information for a Session Factory. An example ehb file with a description of its content can be downloaded here: library.ehb.

Open Resource

When rightclicking on an ehb file the Teneo menu option is displayed. Within this menu the option Open Resource is shown. Choosing this option will open a EMF editor which reads its contents from the connection/session information in the ehb file.

Resource utility

Export/Import to and from XMI or XML

The XML/XMI export function can be used to make a backup of your current data and import this data again in an empty (new) database. The main drawback of the XML/XMI import is that it will add all the content to the database and will not check if the content already exists in the database. Note that the XMI export/import is more powerfull (than XML) because it supports export/import of multiple root objects.

Throubleshooting: empty editor when opening resource, can not add

When you open an empty resource (relational database) by right clicking on the ehb file an editor is opened which does not allow you to add the first document. This is a restriction of the generated EMF editor. So you should always have at least one document in the resource. This document can be created by importing from a XML document or by using the standard EMF open model wizard.

Throubleshooting: the editor is not started but instead the ehb file is opened in the text editor

This happens when the ehb file is already open in a text editor. This can happen because you need to edit the properties in a text editor. So first close the text editor with the ehb file and then choose 'Open Resource'.

Throubleshooting: editor does not start, AssertionFailedException

See here in the troubleshooting page.

Future extensions

  • Instead of a property file offer a more advanced ui
  • Extend the export/import to support different modes such as overwrite existing documents, add to the relational store etc.
  • Support for xsl transformations when exporting/importing
  • Export subsets of the relational store using HQL queries or other filtering

Please post a message on the newsgroup if you have other ideas or requirements for resource utilities.