Difference between revisions of "CDO/Hibernate Store/Architecture"
Latest revision as of 20:08, 27 December 2010
The CDO Hibernate Store makes use of 2 distinctive components:
- Hibernate: for runtime object relational mapping from CDO objects to a relational database, support for HQL queries from the client.
- Teneo: responsible for the Model-Relational mapping from one or more ecore models possibly annotated with JPA annotations to control the mapping.
The Teneo component is focused on generating the mapping to Hibernate (so the runtime components of Teneo are not used). The actual runtime implementation consists of an implementation of a CDO data store (supporting the CDO api for data stores) and Hibernate itself.
The image below illustrates the relation between the components. It shows that the store implementation itself is transparent to the client. The Hibernate store supports the same api as other CDO stores. The Hibernate store has an additional feature that it supports HQL as the query language on the client.
At runtime the components (CDO, Teneo, Hibernate) operate together to provide a complete solution:
- at startup the package store is created to store ecore packages in the database. The package store uses Hibernate to store ecore packages in a fixed database schema.
- when the client registers a new ecore package and commits then the following actions take place:
- the new ecore package is stored in the database (using the package store)
- a new mapping is generated (using Teneo) for the new ecore package and all the already existing packages
- the hibernate store (which stores the actual data) is re-initialized with the new mapping
- depending on specific Hibernate properties the database schema is updated
- when the user commits actual CDO objects then hibernate is called to update/insert/delete the objects from the database
- the user can fire HQL queries directly from the client to server. The Hibernate QueryHandler takes care of executing the queries and returning the results.