Difference between revisions of "CDO/Hibernate Store"

From Eclipsepedia

< CDO
Jump to: navigation, search
(Documentation)
(Dependencies)
(30 intermediate revisions by 2 users not shown)
Line 2: Line 2:
  
  
The CDO Hibernate store is a CDO store implemented with [http://www.eclipse.org/modeling/emf/?project=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 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.
 
* '''HQL''': the CDO Hibernate store makes it possible to execute [http://docs.jboss.org/hibernate/core/3.3/reference/en/html/queryhql.html HQL] queries on the client. The complete HQL syntax is supported (incl. joins, aggregations, functions, etc.).
 
* '''HQL''': the CDO Hibernate store makes it possible to execute [http://docs.jboss.org/hibernate/core/3.3/reference/en/html/queryhql.html 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. Basically 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 very much focused on creating a readable, 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 15: 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|CDO Hibernate Store HQL page]]''': 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 standard the 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_Trouble_Shooting|Trouble shooting]]''': 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]'''.
  
== Current status ==
+
== Dependencies ==
  
Currently the CDO Hibernate datastore 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.
+
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.
  
The CDO Hibernate Store currently does not support the following CDO features:
+
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.
 +
 
 +
== 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:
 +
* [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
 +
* [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
 +
* [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 ==
 +
 
 +
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.  
 
* 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
  
 +
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]]
 
Wikis: [[CDO]] | [[Net4j]] | [[EMF]] | [[Eclipse]]
 +
 +
[[Category:CDO]] [[Category:Net4j]] [[Category:EMF]] [[Category:Eclipse]] [[Category:Teneo]] [[Category:Hibernate]]

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