Jump to: navigation, search

Difference between revisions of "CDO/Hibernate Store"

< CDO
(Dependencies)
(10 intermediate revisions by 2 users not shown)
Line 2: Line 2:
  
  
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 29: Line 29:
 
* '''[[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.
  
* '''[[CDO/Hibernate_Store/Troubleshooting|Troubleshooting]]''': when you encounter specific CDO Hibernate issues. For remaining questions visit the '''[http://www.eclipse.org/modeling/emf/newsgroup-mailing-list.php EMF]''' newsgroup.
+
* '''[[CDO/Hibernate_Store/Troubleshooting|Troubleshooting]]''': when you encounter specific CDO Hibernate issues. For remaining questions visit the '''[http://www.eclipse.org/modeling/emf/newsgroup-mailing-list.php EMF newsgroup]'''.
  
 
== Dependencies ==
 
== Dependencies ==
  
The Hibernate store is build and distributed as part of [[CDO]] 3.0. CDO 3.0 is the CDO release for the [[Helios|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.
 +
 
 +
The Hibernate Store is tested with this software:
 +
* Eclipse 3.8: Eclipse 3.8 ([[Juno]]), [[EMF]] 2.8, CDO 4.1, Hibernate 4.1.*, [[Teneo/Hibernate]] 2.0.0
 +
* Eclipse 3.7: Eclipse 3.7 ([[Indigo]]), [[EMF]] 2.7, CDO 4.0, Hibernate 3.6.0, [[Teneo/Hibernate]] 2.0.0 or 1.2.0
 +
* Eclipse 3.6: Eclipse 3.6 ([[Helios]]), [[EMF]] 2.6, CDO 3.0, Hibernate 3.6.0, [[Teneo/Hibernate]] 1.2.0
  
 
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 [[CVS]] in the following location:
+
The CDO Hibernate Store can be found in git in the following location:  
* dev.eclipse.org
+
http://git.eclipse.org/c/cdo/cdo.git/
* /cvsroot/modeling
+
* main path: org.eclipse.emf/org.eclipse.emf.cdo/hibernate
+
  
The functionality is implemented in the following plugins (the other plugins/projects in the same cvs location can be ignored):
+
To clone the cdo repository:
* org.eclipse.emf.cdo.server.hibernate: implements the CDO Hibernate Store itself
+
git clone http://git.eclipse.org/c/cdo/cdo.git/
* org.eclipse.emf.cdo.server.hibernate.teneo: integrates Teneo with the CDO Hibernate Store, takes care of calling Teneo to generate the mapping
+
* org.eclipse.emf.cdo.test.hibernate: contains the Hibernate specific parts of the cdo tests. This plugin extends the org.eclipse.emf.cdo.tests plugin
+
  
The documentation makes use of three projects (used in the documentation) in the org.eclipse.emf/org.eclipse.emf.cdo/examples folder:
+
The functionality is implemented in the following plugins:
* 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.server.hibernate org.eclipse.emf.cdo.server.hibernate]: implements the CDO Hibernate Store itself
* org.eclipse.emf.cdo.examples.hibernate.server: contains server configuration and a launch configuration
+
* [http://git.eclipse.org/c/cdo/cdo.git/tree/plugins/org.eclipse.emf.cdo.server.hibernate.teneo org.eclipse.emf.cdo.server.hibernate.teneo]: integrates Teneo with the CDO Hibernate Store, takes care of calling Teneo to generate the mapping
* 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.tests.hibernate org.eclipse.emf.cdo.tests.hibernate]: contains the Hibernate specific parts of the cdo tests. This plugin extends the org.eclipse.emf.cdo.tests plugin
  
 +
The documentation makes use of three example projects:
 +
* [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
 +
* [http://git.eclipse.org/c/cdo/cdo.git/tree/plugins/org.eclipse.emf.cdo.examples.hibernate.server org.eclipse.emf.cdo.examples.hibernate.server]: contains server configuration and a launch configuration
 +
* [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.
  
 
== (Un)Supported Functions and Features ==
 
== (Un)Supported Functions and Features ==

Revision as of 05:28, 19 May 2012


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.
  • HQL: the CDO Hibernate store makes it possible to execute HQL queries on the client. The complete HQL syntax is supported (incl. joins, aggregations, functions, etc.).
  • 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.

Dependencies

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 Eclipse 3.6 (Helios) release. CDO 4.0 is the CDO release for the Eclipse 3.7 (Indigo) release. CDO 4.1 is the CDO release for the 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 download & install) to download the CDO Hibernate Store for Indigo.

The Hibernate Store is tested with this software:

Visit the download page to download the required dependencies.

Plugins - Dev Projects

The CDO Hibernate Store can be found in git in the following location: http://git.eclipse.org/c/cdo/cdo.git/

To clone the cdo repository: git clone http://git.eclipse.org/c/cdo/cdo.git/

The functionality is implemented in the following plugins:

The documentation makes use of three example projects:

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

Wikis: CDO | Net4j | EMF | Eclipse