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.

* '''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.

+

* '''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-readable, 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.

+

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 ==

== Documentation ==

Line 16:

Line 15:

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

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

−

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

+

* '''[[CDO/Hibernate_Store/Quick_Start|Quick start]]''': in just a few steps you have an up-and-running CDO server with Hibernate and automatic mapping using Teneo.

−

* '''[[CDO_Hibernate_Store_Architecture|Architecture]]''': describes how the different components of the store operate together.

+

* '''[[CDO/Hibernate_Store/Architecture|Architecture]]''': describes how the different components of the store operate together.

−

* '''[[CDO_Hibernate_Store_Download_and_Install|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).

+

* '''[[CDO/Hibernate_Store/Download_and_Install|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).

−

* '''[[CDO_Hibernate_Store_Configuration_and_Setup|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.

+

* '''[[CDO/Hibernate_Store/Configuration_and_Setup|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.

−

* '''[[CDO_Hibernate_Store_Start_Tutorial|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.

+

* '''[[CDO/Hibernate_Store/Tutorial|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.

−

* '''[[CDO_Hibernate_Store_HQL|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.

+

* '''[[CDO/Hibernate_Store/HQL|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.

−

* '''[[CDO_Hibernate_Store_Model_Relational_Mapping|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.

+

* '''[[CDO/Hibernate_Store/Model_Relational_Mapping|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.

The Hibernate store is build and distributed as part of CDO 3.0. CDO 3.0 is the CDO release for the Eclipse 3.6 (Helios) release. The Hibernate Store is tested with this software:

+

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.

−

* Eclipse 3.6 (Helios)

+

−

* EMF 2.6

+

−

* CDO 3.0

+

−

* Hibernate 3.3.2 or later

+

−

* Teneo 1.2.0

+

−

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.

+

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.

−

Visit the [[CDO_Hibernate_Store_Download_and_Install|download ]] page to download the required dependencies.

* [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.

−

Currently the CDO Hibernate Store successfully passes 540 out of a total of about 580 testcases. The 40 remaining testcases are related to functions and features not (yet) supported by the CDO Hibernate store (see below).

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

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.

* 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.

−

* XATransactions: xatransactions are not tested well and not all test cases pass currently

+

* Branching: is not supported

+

See also the list of Teneo Auditing [[Teneo/Hibernate/Auditing#Limitations|limitations]], these limitations also apply here.

+

+

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.

Revision as of 09:40, 29 November 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

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

See also the list of Teneo Auditing limitations, these limitations also apply here.

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.