HomeEMF HibernateEMF JDO/JPOXWeb App GenerationServices
 

Upgrading EMF - Hibernate Plugins

Describes specific aspects of upgrading the EMF - Hibernate plugins

Upgrading to Teneo

The Teneo plugins have different names and ids than the Elver plugins. This means that if you install Teneo plugins that they will coexist next to the installed Elver plugins. This should not be a problem but can lead to confusion because the classnames (without the package names) have stayed the same (for example HbDataStore is called the same in Teneo and in Elver).

There is no automatic removal of Elver plugins, this has to be done manually (see below).

Changes from a 0.3.* to the 0.7.0 release

Going from the 0.3.* release to the 0.7.0 release Elver has changed in many places. The main change is that it is not required anymore to generate an intermediate hibernate.hbm.xml file. The mapping is done at runtime based on the ecore file.

The main entrance class the HibernateHelper has been replaced by HbHelper. The interface of this class is cleaner than its predecessor. A new class has been introduced: HbDataStore. This class represents the combination of a set of EPackages and a relational store. The HbDataStore can be used for different purposes. See here.

Another major change is that in the HQL queries the EClass name should now be used instead of the java class names.

Regenerate hibernate.hbm.xml after upgrading

New functionality and bug fixes can result in changes in the generated hibernate.hbm.xml. New versions can depend on an updated hibernate.hbm.xml. So after upgrading it is sometimes necessary to regenerate the hibernate.hbm.xml file.

Upgrade through the Update Manager: Search for upgrades... or Search for new Features...

Depending on how you defined valid upgrades in windows > preferences > Install/Updates, it is possible that the 'Search for Upgrades of installed features' in the update manager will not find the updated EMF-Hibernate plugin. If this happens then the 'Search for new Features..' option should be chosen in the Update Manager.

After the Elver plugins has been downloaded the update manager will detect that the 'new' feature is in fact an upgrade of an already installed feature. The old-version of the feature will automatically be disabled. This is visible in the Manage Configuration function in the Help > Sofware Updates menu.

Changed datamodel after upgrading

The OR Mapper is also updated to solve issues and add functionality. This can mean that the hibernate.hbm.xml generated by the OR Mapper differs from one version to another. Resulting in a different database schema. When the database already exists from previous versions this can mean that the new expected database schema does not correspond with the old database schema.

Hibernate will try to correct differences by adding tables and columns. However not all changes can be automatically repaired.

The issues can be resolved by manually adding missing columns. Another way to resolve the above issue is to start again with a new empty database. Hibernate will then automatically create new tables which adhere to the package.jdo

For the longer term we are considering to offer tools which will better facilitate this upgrade process. For example to allow data to be copied from the relational EMF store to a temporary XML Resource, create the new database and schema and then copy the information back.