Jump to: navigation, search

Difference between revisions of "CDO/DB Store"

< CDO
(Features)
(Added hint recommending to always define the columnLength for the String data type)
Line 15: Line 15:
 
     </eStructuralFeatures>
 
     </eStructuralFeatures>
  
== Configuration ==
+
== Configuration ==
  
* Configuring the DBStore: see [[CDO/Server_Configuration_Reference#Element_store]].
+
*Configuring the DBStore: see [[CDO/Server Configuration Reference#Element_store]].
 +
 
 +
<br>
 +
 
 +
== Annotations  ==
 +
 
 +
You can define some custom mappings on your model by using EAnnotations for DBStore.
 +
 
 +
In order to optimize the schema on the database, it is recommended that you define the column length, specially when using the data type String.
 +
 
 +
Example:
 +
<pre>&nbsp;&lt;eStructuralFeatures xsi:type="ecore:EAttribute" name="name" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"&gt;
 +
&nbsp; &nbsp; &nbsp;&lt;eAnnotations source="http://www.eclipse.org/CDO/DBStore"&gt;
 +
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&lt;details key="columnType" value="VARCHAR"/&gt;
 +
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&lt;details key="columnLength" value="255"/&gt;
 +
&nbsp; &nbsp; &nbsp;&lt;/eAnnotations&gt;
 +
&nbsp;&lt;/eStructuralFeatures&gt;
 +
</pre>
  
  
 
----
 
----
 +
 
Wikis: [[CDO]] | [[Net4j]] | [[EMF]] | [[Eclipse]]
 
Wikis: [[CDO]] | [[Net4j]] | [[EMF]] | [[Eclipse]]

Revision as of 17:42, 20 November 2012

The CDO DB store is an implementation of the CDO IStore that allows to store models and meta models in relational databases. It does not use 3rd party components other than database vendor-specific JDBC drivers. The DB store is a proprietary O/R mapper.

Features

  • Supports all optional features of the CDO Server.
  • Pluggable SQL dialect adapters. Includes support for Derby, H2, HSQLDB, MySQL, PostgreSQL and Oracle .
  • Pluggable mapping strategies. Includes horizontal mapping strategy (one table per concrete class, no joins).
  • Various mapping options by using EAnnotations on model elements: DBAnnotation.java. Example:
   <eStructuralFeatures xsi:type="ecore:EAttribute" name="name" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString">
     <eAnnotations source="http://www.eclipse.org/CDO/DBStore">
       <details key="columnType" value="VARCHAR"/>
       <details key="columnLength" value="255"/>
     </eAnnotations>
   </eStructuralFeatures>

Configuration


Annotations

You can define some custom mappings on your model by using EAnnotations for DBStore.

In order to optimize the schema on the database, it is recommended that you define the column length, specially when using the data type String.

Example:

 <eStructuralFeatures xsi:type="ecore:EAttribute" name="name" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString">
     <eAnnotations source="http://www.eclipse.org/CDO/DBStore">
         <details key="columnType" value="VARCHAR"/>
         <details key="columnLength" value="255"/>
     </eAnnotations>
 </eStructuralFeatures>



Wikis: CDO | Net4j | EMF | Eclipse