The CDO Hibernate store is a [[CDO]] store implemented with [[Teneo|Teneo]] and [http://www.hibernate.org Hibernate]. This combination of tools gives the user/developer the following advantages:

+

The CDO Hibernate store is a [[CDO]] store implemented with [[Teneo/Hibernate|Teneo]] and [http://www.hibernate.org Hibernate]. This combination of tools gives the user/developer the following advantages:

* '''Database support''': Hibernate provides superior runtime Object Relational Mapping to many different relational databases. We test with mysql and hsqldb but there are no known obstacles for using CDO on other databases supported by Hibernate.

* '''Database support''': Hibernate provides superior runtime Object Relational Mapping to many different relational databases. We test with mysql and hsqldb but there are no known obstacles for using CDO on other databases supported by Hibernate.

Line 33:

Line 33:

== Dependencies ==

== Dependencies ==

−

The Hibernate store is build and distributed as part of [[CDO]] 3.0 and 4.0. CDO 3.0 is the CDO release for the [[Helios|Eclipse 3.6 (Helios)]] release. CDO 4.0 is the CDO release for the [[Indigo|Eclipse 3.7 (Indigo)]] release.

+

The Hibernate store is build and distributed as part of [[CDO]] 3.0, 4.0 and 4.1. CDO 3.0 is the CDO release for the [[Helios|Eclipse 3.6 (Helios)]] release. CDO 4.0 is the CDO release for the [[Indigo|Eclipse 3.7 (Indigo)]] release. CDO 4.1 is the CDO release for the [[Juno|Eclipse 3.8 (Juno)]] release.

Note: the Hibernate store is '''not''' available on the Indigo update sites, you have to use CDO update sites (see [[CDO/Hibernate_Store/Download_and_Install|download & install]]) to download the CDO Hibernate Store for Indigo.

Note: the Hibernate store is '''not''' available on the Indigo update sites, you have to use CDO update sites (see [[CDO/Hibernate_Store/Download_and_Install|download & install]]) to download the CDO Hibernate Store for Indigo.

Note: the tutorials have been run also using '''Eclipse 3.5 and EMF 2.5''' and this works fine (using CDO 3.0, Teneo 1.2.0 and Hibernate 3.3.2). There should not be any binary incompatibility between CDO 3.0 and Eclipse 3.5, EMF 2.5.

+

Visit the [[CDO/Hibernate_Store/Download_and_Install|download ]] page to download the required dependencies.

Visit the [[CDO/Hibernate_Store/Download_and_Install|download ]] page to download the required dependencies.

−

== Plugins and CVS ==

+

== Plugins - Dev Projects ==

+

+

The CDO Hibernate Store can be found in git in the following location:

+

http://git.eclipse.org/c/cdo/cdo.git/

−

The CDO Hibernate Store can be found in SVN in the following location: https://dev.eclipse.org/svnroot/modeling/org.eclipse.emf.cdo/trunk/plugins

The documentation makes use of three projects (used in the documentation) in the org.eclipse.emf/org.eclipse.emf.cdo/examples folder:

+

The documentation makes use of three example projects:

−

* [https://dev.eclipse.org/svnroot/modeling/org.eclipse.emf.cdo/trunk/plugins/org.eclipse.emf.cdo.examples.company org.eclipse.emf.cdo.examples.company]: contains the test model which has been enabled for use with CDO

+

* [http://git.eclipse.org/c/cdo/cdo.git/tree/plugins/org.eclipse.emf.cdo.examples.company org.eclipse.emf.cdo.examples.company]: contains the test model which has been enabled for use with CDO

* [https://dev.eclipse.org/svnroot/modeling/org.eclipse.emf.cdo/trunk/plugins/org.eclipse.emf.cdo.examples.hibernate.client org.eclipse.emf.cdo.examples.hibernate.client]: contains several test cases showing how a client can create data and query for data in a remote CDO server.

+

* [http://git.eclipse.org/c/cdo/cdo.git/tree/plugins/org.eclipse.emf.cdo.examples.hibernate.client org.eclipse.emf.cdo.examples.hibernate.client]: contains several test cases showing how a client can create data and query for data in a remote CDO server.

Revision as of 05:28, 19 May 2012

Contents

The CDO Hibernate store is a CDO store implemented with Teneo and Hibernate. This combination of tools gives the user/developer the following advantages:

Database support: Hibernate provides superior runtime Object Relational Mapping to many different relational databases. We test with mysql and hsqldb but there are no known obstacles for using CDO on other databases supported by Hibernate.

Automatic Model-Relational Mapping: Teneo takes care of automatic mapping of your model to a relation database schema. The relational database schema explicitly implements the domain model. The automatic mapping can be manually overridden using JPA annotations in the model or in a separate XML file. All JPA annotations (and several Hibernate extensions) are supported.

The CDO Hibernate store is focused on creating a human-understandable, sensible, practical and performant relational database schema. The store is especially suited for data oriented business administrative (ERP-like) applications with a RCP interface.

Documentation

The documentation for the CDO Hibernate Store consists of the following sections.

Quick start: in just a few steps you have an up-and-running CDO server with Hibernate and automatic mapping using Teneo.

Architecture: describes how the different components of the store operate together.

Download and install: lists the required plugins and their download locations. In addition the examples projects used in the tutorials are specified (with their cvs location).

Configuration: discusses the setup and configuration of the CDO Hibernate store (database, launch configuration, model, etc.). The description is supported by an example Eclipse project which is available in cvs.

Tutorial: gives a quick intro in how to connect from a client to the CDO Hibernate datastore. This tutorial illustrates that for a standard usage there is no difference in using a CDO Hibernate store compared to other stores. A downloadable Example Eclipse project is used to give the reader a good start. The examples use junit testcases on the client to facilitate easy testing and debugging.

Hibernate Query Language (HQL) support: several examples of HQL queries, ranging from very simple to queries with functions and array results. The example queries can be run directly using a provided Eclipse project.

Model relational mapping page describes how the generated model-relational mapping can be extended and overridden using JPA annotations in the model. The same example Eclipse project as in previous steps is used to illustrate the functions and features.

(Un)Supported Functions and Features

Currently the CDO Hibernate Store successfully passes 963 testcases.

The CDO Hibernate Store supports the main CDO features except for the following:

auditing and revisions: this topic is being researched. Support for auditing as it is currently implemented in CDO implies that there are no foreign key constraints in the database. This has to be matched with the focus of the CDO Hibernate store on supporting more traditional ERP/Business Administration applications.

Branching: is not supported

The following details are related to differences in the way CDO works natively and the Teneo mapping layer:

Non-transient containment ereference with a transient e-opposite container ereference: CDO will ignore the transient container ereference, while Teneo and the Hibernate Store will try to persist it. This results in runtime exceptions. This case is a very special case, support for this case will be provided when it is specifically requested on the EMF newsgroup.

CDOStaleReferencePolicy option is not supported: the Hibernate Store will treat all stale references as an exception.

Move of child from one container to another container: Hibernate does not support moving of a child (part of a containment or orphan-delete association) to another parent. Hibernate will throw an exception with a message like: 'Deleted object will be re-saved'. To work around this issue make a shallow copy of the child and insert the copy in the new parent.