Skip to main content

Notice: this Wiki will be going read only early in 2024 and edits will no longer be possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.

Jump to: navigation, search

Difference between revisions of "Teneo/Hibernate"

(Model Relational Mapping with EJB3/JPA Annotations)
(Configuration and Usage Details)
 
(42 intermediate revisions by 2 users not shown)
Line 1: Line 1:
'''NOTE: the documentation for Hibernate is currently (January 2010) being transferred from the [http://www.elver.org current site] to the Eclipse wiki. This means that the pages in the wiki can be incomplete until the transfer is complete. For the complete documentation visit the current site: [http://www.elver.org here].'''
 
 
 
__TOC__
 
__TOC__
  
Line 9: Line 7:
 
Teneo offers full support for EMF XML Schema constructs, see the [[Teneo/Hibernate#XML_Schema_Support|Teneo XML Schema pages]] for more information.
 
Teneo offers full support for EMF XML Schema constructs, see the [[Teneo/Hibernate#XML_Schema_Support|Teneo XML Schema pages]] for more information.
  
The EMF, Hibernate and Teneo versions are related as follows:
+
Teneo is delivered in different versions supporting from EMF 2.5, Eclipse 3.5 and Hibernate 3.2 to EMF 2.8, Eclipse 3.8 and Hibernate 4.1.*. See the download page for the correct version of Teneo for your environment.
  
* Teneo '''1.0.4''': for Eclipse 3.4-3.3/EMF 2.4-2.3/hibernate 3.2/3.3.1 and jdk 1.5
+
== Overview, Download & Install and Quickstart ==
* Teneo '''1.1.0''': for Eclipse 3.5/EMF 2.5/hibernate 3.2/3.3.1 and jdk 1.5
+
* Teneo '''1.1.1/1.1.2''': Maintenance Builds for Eclipse 3.5/EMF 2.5/hibernate 3.3.2 and jdk 1.5
+
* Teneo '''1.2.0''': Stable Builds for Eclipse 3.6/EMF 2.6/hibernate 3.3.2 and jdk 1.5
+
  
 +
* '''[[Teneo/Hibernate/Architecture_Overview|Architecture Overview]]''': describes the components of the Teneo solution and how they interact and work with Hibernate.
  
'''Note''': the difference in hibernate versions between the 1.1.0 and 1.1.1 and higher builds. Hibernate introduced a binary incompatibility in version 3.3.2, forcing Teneo to adhere to this.
+
* '''[[Teneo/Hibernate/Download_and_Install|Download and Install]]''': describes downloading and installing Teneo for usage in OSGI as well as Web Container environments. Also the installation/download of the example projects used in the tutorials is discussed here.
  
== Overview, download & install and Quickstart ==
+
* '''[[Teneo/Hibernate/QuickStart|Quickstart]]''': starting from an ecore model, the tutorial shows how to work with the generated model code and persist the objects in a (generated) database.
  
 +
== Tutorials ==
  
 +
The tutorials are based on the example project which can be [[Teneo/Hibernate/Download_and_Install#Download_Example_Project_for_Tutorials|downloaded]] from git.
  
== Tutorials ==
+
The tutorials assume a basic knowledge of EMF. If you are new to EMF then it can make sense to first try one of the core EMF tutorials which you can find [http://eclipse.org/modeling/emf/docs/#tutorials here].
 
+
  
 +
* '''[[Teneo/Hibernate/QuickStart|Quickstart]]''': starting from an ecore model, the tutorial shows how to work with the generated model code and persist the objects in a (generated) database.
 +
* '''[[Teneo/Hibernate/Tutorial|Tutorial]]''': this tutorial takes you a bit further, it persists new objects, shows a number of [http://docs.jboss.org/hibernate/core/3.3/reference/en/html/queryhql.html HQL] queries and also shows how the [[Teneo/Hibernate/EMF_Resource|Hibernate EMF resource]] operates.
 +
* '''[[Teneo/Hibernate/Editor_Tutorial|Editor Tutorial]]''': shows how the generated EMF editor can work using Teneo on a relational persistence layer.
 +
* '''[[Teneo/Hibernate/Dynamic_EMF_Tutorial|Dynamic EMF Tutorial]]''': Teneo also works fine with dynamic EMF and can even handle changes to the EMF model at runtime. This tutorial shows some examples of this.
 +
* '''[[Teneo/Hibernate/GMF|GMF]]''': Teneo works with [http://eclipse.org/modeling/gmf/ GMF] also. This tutorial shows how to setup the GMF mindmap example with Teneo.
  
 
== Configuration and Usage Details ==
 
== Configuration and Usage Details ==
Line 31: Line 33:
 
* '''[[Teneo/Hibernate/Configuration_Options|Configuration Options]]''': Teneo has many (40+) configuration options controlling mapping and runtime behavior.  
 
* '''[[Teneo/Hibernate/Configuration_Options|Configuration Options]]''': Teneo has many (40+) configuration options controlling mapping and runtime behavior.  
  
* '''[[Teneo/Hibernate/Hibernate_Datastore|Hibernate Session and Entitymanager Datastores]]''': Teneo implements the runtime persistence functionality through a data store concept which takes care of initializing the runtime layers.
+
* '''[[Teneo/Hibernate/Hibernate_Datastore|Hibernate Session and Entitymanager Datastores, Spring setup]]''': Teneo implements the runtime persistence functionality through a data store concept which takes care of initializing the runtime layers. This section also describes integration with the Spring framework.
  
* '''[[Teneo/Hibernate/Extensions|Teneo extensions]]''': the Teneo extensions mechanism allows you to override and replace core Teneo components.
+
* '''[[Teneo/Hibernate/Extensions|Teneo extensions]]''': the Teneo extensions mechanism allows you to override and replace core Teneo components with your own implementations.
  
 
* '''[[Teneo/Hibernate/EMF_Hibernate_Integration_Details|EMF Hibernate Integration Details]]''': discusses several detailed aspects of the integration between Hibernate and EMF, for example: use of a package registry, classloading, escaping of table and column names, synthetic id and version, etc.
 
* '''[[Teneo/Hibernate/EMF_Hibernate_Integration_Details|EMF Hibernate Integration Details]]''': discusses several detailed aspects of the integration between Hibernate and EMF, for example: use of a package registry, classloading, escaping of table and column names, synthetic id and version, etc.
  
 
* '''[[Teneo/Hibernate/EMF_Resource|Hibernate Resource]]''': discusses the Teneo specific implementation of the EMF Resource concept.
 
* '''[[Teneo/Hibernate/EMF_Resource|Hibernate Resource]]''': discusses the Teneo specific implementation of the EMF Resource concept.
 +
 +
* '''[[Teneo/Hibernate/Collection_Extra-Lazy_Loading|Collection Extra-Lazy Loading]]''': describes how to work with very large collections.
 +
 +
* '''[[Teneo/Hibernate/Auditing|Auditing]]''': Teneo supports auditing (from November 2012), you can determine which types are audited, you can retrieve earlier versions and iterate over the version history of objects.
  
 
== Model Relational Mapping with EJB3/JPA Annotations ==
 
== Model Relational Mapping with EJB3/JPA Annotations ==
Line 67: Line 73:
 
* '''[[Teneo/Hibernate/XMLSchema/FeatureMap|Feature Map and Mixed Content]]''': discusses how Teneo supports mixed content and feature maps.
 
* '''[[Teneo/Hibernate/XMLSchema/FeatureMap|Feature Map and Mixed Content]]''': discusses how Teneo supports mixed content and feature maps.
  
 +
== CDO - CDO Hibernate Store ==
  
== CVS, Support and FAQ ==
+
Teneo is also used within a component of the [[CDO|CDO]] solution: the CDO Hibernate Store. For more information visit the [[CDO_Hibernate_Store|CDO Hibernate Store wiki page]].
 
+
The Teneo source code can be found here (CVS):
+
* dev.eclipse.org
+
* /cvsroot/modeling
+
* org.eclipse.emf/org.eclipse.emf.teneo
+
  
If you encounter issues, check the [[Teneo/Hibernate/FAQ|FAQ]] page.
+
== More Information ==
  
Support for Teneo is given on the [http://www.eclipse.org/modeling/emf/newsgroup-mailing-list.php EMF newsgroup]. For accessing the news group through a browser visit this [http://www.eclipse.org/forums/index.php?t=thread&frm_id=108 page].
+
See:
 +
* [[Teneo#GIT.2C_Support.2C_Commit_Mailing_List_and_FAQ|Teneo GIT, Support, Commit Mailing List and FAQ]]
 +
* [[Teneo#Continuous_Build|Teneo Continuous Build]]

Latest revision as of 18:52, 2 November 2012

The EMF - Hibernate integration supports all EMF features and standard Hibernate features. EMF objects can be persisted in most major relational databases and retrieved using an EMF resource approach or HQL queries.

A distinctive feature of Teneo is that you can override/extend the Model-Relational mapping using JPA annotations in the model, see the JPA/EJB3 pages for more information.

Teneo offers full support for EMF XML Schema constructs, see the Teneo XML Schema pages for more information.

Teneo is delivered in different versions supporting from EMF 2.5, Eclipse 3.5 and Hibernate 3.2 to EMF 2.8, Eclipse 3.8 and Hibernate 4.1.*. See the download page for the correct version of Teneo for your environment.

Overview, Download & Install and Quickstart

  • Architecture Overview: describes the components of the Teneo solution and how they interact and work with Hibernate.
  • Download and Install: describes downloading and installing Teneo for usage in OSGI as well as Web Container environments. Also the installation/download of the example projects used in the tutorials is discussed here.
  • Quickstart: starting from an ecore model, the tutorial shows how to work with the generated model code and persist the objects in a (generated) database.

Tutorials

The tutorials are based on the example project which can be downloaded from git.

The tutorials assume a basic knowledge of EMF. If you are new to EMF then it can make sense to first try one of the core EMF tutorials which you can find here.

  • Quickstart: starting from an ecore model, the tutorial shows how to work with the generated model code and persist the objects in a (generated) database.
  • Tutorial: this tutorial takes you a bit further, it persists new objects, shows a number of HQL queries and also shows how the Hibernate EMF resource operates.
  • Editor Tutorial: shows how the generated EMF editor can work using Teneo on a relational persistence layer.
  • Dynamic EMF Tutorial: Teneo also works fine with dynamic EMF and can even handle changes to the EMF model at runtime. This tutorial shows some examples of this.
  • GMF: Teneo works with GMF also. This tutorial shows how to setup the GMF mindmap example with Teneo.

Configuration and Usage Details

  • Configuration Options: Teneo has many (40+) configuration options controlling mapping and runtime behavior.
  • Teneo extensions: the Teneo extensions mechanism allows you to override and replace core Teneo components with your own implementations.
  • EMF Hibernate Integration Details: discusses several detailed aspects of the integration between Hibernate and EMF, for example: use of a package registry, classloading, escaping of table and column names, synthetic id and version, etc.
  • Hibernate Resource: discusses the Teneo specific implementation of the EMF Resource concept.
  • Auditing: Teneo supports auditing (from November 2012), you can determine which types are audited, you can retrieve earlier versions and iterate over the version history of objects.

Model Relational Mapping with EJB3/JPA Annotations

Teneo can map practically every ecore model to a relational store. The mapping logic can be overridden and controlled by in-model JPA annotations. The annotations are entered in the model (xsd or ecore) directly or set in a separate XML file.

This combination of automatic mapping and manual overrides with JPA annotations is very powerfull. The JPA annotations allow a developer to do many things, for example: determine the naming of columns and tables, enables or prevents join tables, specify embedded components, specify the name of foreign key columns, the inheritance mapping, if an index column is used, the sorting of a collection, enable external references, etc. etc.

For more information, see the following pages:

  • Supported annotations: gives a complete overview of the support for JPA annotations including Hibernate annotation extensions and convenience Teneo extensions.
  • Annotations format: describes in detail how annotations can be specified in the model itself or in a separate XML file. By supporting an external XML it is possible to annotate existing ecore models, so without the need to change them.
  • Association Mapping: describes in detail how associations can be mapped to a relational store, also outlining which annotations and configuration options can be used.

XML Schema Support

Teneo supports practically all XML Schema constructs which are also supported by EMF. Teneo tries to generate a sensible, practical, readable and performant database schema for a XML Schema model. It is important that the domain model concepts are also reflected in the database schema itself.

For more details on the Teneo XML Schema support, visit the following pages:

CDO - CDO Hibernate Store

Teneo is also used within a component of the CDO solution: the CDO Hibernate Store. For more information visit the CDO Hibernate Store wiki page.

More Information

See:

Back to the top