Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEike Stepper2008-02-23 03:26:22 -0500
committerEike Stepper2008-02-23 03:26:22 -0500
commitc5a3c052177759f9be3d6694bf16f591ba98208a (patch)
tree3791ce00048eeac3a646888b55120762b3dc75f0 /plugins/org.eclipse.emf.cdo.server.hibernate/mappings
parentdf3b1fdd17dfabb7925a02139def2084203a8c2d (diff)
downloadcdo-c5a3c052177759f9be3d6694bf16f591ba98208a.tar.gz
cdo-c5a3c052177759f9be3d6694bf16f591ba98208a.tar.xz
cdo-c5a3c052177759f9be3d6694bf16f591ba98208a.zip
[217117] Develop a HibernateStore
https://bugs.eclipse.org/bugs/show_bug.cgi?id=217117
Diffstat (limited to 'plugins/org.eclipse.emf.cdo.server.hibernate/mappings')
-rw-r--r--plugins/org.eclipse.emf.cdo.server.hibernate/mappings/meta.hbm.xml70
-rw-r--r--plugins/org.eclipse.emf.cdo.server.hibernate/mappings/product.hbm.xml218
-rw-r--r--plugins/org.eclipse.emf.cdo.server.hibernate/mappings/resource.hbm.xml28
3 files changed, 316 insertions, 0 deletions
diff --git a/plugins/org.eclipse.emf.cdo.server.hibernate/mappings/meta.hbm.xml b/plugins/org.eclipse.emf.cdo.server.hibernate/mappings/meta.hbm.xml
new file mode 100644
index 0000000000..f3c709c040
--- /dev/null
+++ b/plugins/org.eclipse.emf.cdo.server.hibernate/mappings/meta.hbm.xml
@@ -0,0 +1,70 @@
+<?xml version="1.0"?>
+<!DOCTYPE hibernate-mapping SYSTEM "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
+<hibernate-mapping package="org.eclipse.emf.cdo.internal.protocol.model">
+
+ <class name="CDOModelElementImpl" table="cdo_modelelements" lazy="false">
+ <id name="serverInfo" column="id" type="int">
+ <generator class="increment" />
+ </id>
+ <property name="name" type="string" not-null="true" length="255" />
+ </class>
+
+ <joined-subclass name="CDOPackageImpl" table="cdo_packages" lazy="false" extends="CDOModelElementImpl">
+ <key/>
+ <property name="packageURI" column="uri" type="string" not-null="true" length="255" />
+ <property name="ecore" type="text" not-null="false" />
+ <property name="dynamic" type="boolean" not-null="true" />
+
+ <property name="metaIDRange"
+ type="org.eclipse.emf.cdo.server.internal.hibernate.tuplizer.CDOIDMetaRangeUserType" not-null="true">
+ <column name="metaIDStart" />
+ <column name="metaIDSize" />
+ </property>
+
+ <list name="classes" lazy="false" cascade="all, delete-orphan" access="field">
+ <key />
+ <list-index />
+ <one-to-many class="CDOClassImpl" />
+ </list>
+
+ </joined-subclass>
+
+ <class name="CDOClassProxy" table="cdo_classes_proxy" lazy="false">
+ <id column="id" type="int">
+ <generator class="increment" />
+ </id>
+ <!-- set to not-null=false because it is nullified because of persist order -->
+ <many-to-one name="cdoClass" class="CDOClassImpl" not-null="false" cascade="merge,persist,save-update,lock,refresh" column="cdoclass"/>
+ </class>
+
+ <joined-subclass name="CDOClassImpl" table="cdo_classes" lazy="false" extends="CDOModelElementImpl">
+ <key/>
+ <property name="classifierID" column="classifier" type="int" not-null="true" />
+ <property name="abstract" column="abstract" type="boolean" not-null="true" />
+
+ <list name="superTypes" lazy="false" cascade="merge,persist,save-update,lock,refresh" access="field">
+ <key>
+ <column name="supertype"/>
+ </key>
+ <list-index />
+ <many-to-many class="CDOClassProxy" />
+ </list>
+
+ <list name="features" lazy="false" cascade="all, delete-orphan" access="field">
+ <key />
+ <list-index />
+ <one-to-many class="CDOFeatureImpl" />
+ </list>
+ </joined-subclass>
+
+ <joined-subclass name="CDOFeatureImpl" table="cdo_features" extends="CDOModelElementImpl">
+ <key/>
+ <property name="featureID" column="feature" type="int" not-null="true" />
+ <property name="type" type="org.eclipse.emf.cdo.server.internal.hibernate.tuplizer.CDOTypeUserType"
+ not-null="false" />
+ <many-to-one name="referenceCDOClass" class="CDOClassImpl" column="reftype" not-null="false" cascade="persist, merge, save-update, evict, replicate, lock, refresh"/>
+ <property name="many" type="boolean" not-null="true" />
+ <property name="containment" type="boolean" not-null="false" />
+ </joined-subclass>
+
+</hibernate-mapping> \ No newline at end of file
diff --git a/plugins/org.eclipse.emf.cdo.server.hibernate/mappings/product.hbm.xml b/plugins/org.eclipse.emf.cdo.server.hibernate/mappings/product.hbm.xml
new file mode 100644
index 0000000000..174d68a56f
--- /dev/null
+++ b/plugins/org.eclipse.emf.cdo.server.hibernate/mappings/product.hbm.xml
@@ -0,0 +1,218 @@
+<?xml version="1.0"?>
+<!DOCTYPE hibernate-mapping SYSTEM "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
+
+<hibernate-mapping auto-import="false">
+ <class entity-name="Address" abstract="false" lazy="false" discriminator-value="Address" table="`address`">
+ <meta attribute="eclassName">Address</meta>
+ <meta attribute="epackage">http://www.eclipse.org/emf/CDO/tests/model1/1.0.0</meta>
+ <tuplizer entity-mode="pojo" class="org.eclipse.emf.cdo.server.internal.hibernate.tuplizer.CDORevisionTuplizer"/>
+ <tuplizer entity-mode="dynamic-map" class="org.eclipse.emf.cdo.server.internal.hibernate.tuplizer.CDORevisionTuplizer"/>
+ <id type="long" name="e_id" column="e_id" access="org.eclipse.emf.teneo.hibernate.mapping.identifier.IdentifierPropertyHandler">
+ <meta attribute="syntheticId">true</meta>
+ <generator class="native"/>
+ </id>
+ <discriminator column="`dtype`" type="string"/>
+ <version name="e_version" column="e_version" access="org.eclipse.emf.teneo.hibernate.mapping.property.VersionPropertyHandler">
+ <meta attribute="syntheticVersion">true</meta>
+ </version>
+ <property name="name" lazy="false" insert="true" update="true" not-null="false" unique="false" type="java.lang.String">
+ <column not-null="false" unique="false" name="`name`"/>
+ </property>
+ <property name="street" lazy="false" insert="true" update="true" not-null="false" unique="false" type="java.lang.String">
+ <column not-null="false" unique="false" name="`street`"/>
+ </property>
+ <property name="city" lazy="false" insert="true" update="true" not-null="false" unique="false" type="java.lang.String">
+ <column not-null="false" unique="false" name="`city`"/>
+ </property>
+ </class>
+ <subclass entity-name="Company" abstract="false" lazy="false" extends="Address" discriminator-value="Company">
+ <meta attribute="eclassName">Company</meta>
+ <meta attribute="epackage">http://www.eclipse.org/emf/CDO/tests/model1/1.0.0</meta>
+ <tuplizer entity-mode="pojo" class="org.eclipse.emf.cdo.server.internal.hibernate.tuplizer.CDORevisionTuplizer"/>
+ <tuplizer entity-mode="dynamic-map" class="org.eclipse.emf.cdo.server.internal.hibernate.tuplizer.CDORevisionTuplizer"/>
+ <list name="categories" lazy="true" cascade="all,delete-orphan">
+ <key update="true" foreign-key="company_categories">
+ <column name="`company_categories_e_id`" not-null="false" unique="false"/>
+ </key>
+ <list-index column="`company_categories_idx`"/>
+ <one-to-many entity-name="Category"/>
+ </list>
+ <list name="suppliers" lazy="true" cascade="all,delete-orphan">
+ <key update="true" foreign-key="company_suppliers">
+ <column name="`company_suppliers_e_id`" not-null="false" unique="false"/>
+ </key>
+ <list-index column="`company_suppliers_idx`"/>
+ <one-to-many entity-name="Supplier"/>
+ </list>
+ <list name="customers" lazy="true" cascade="all,delete-orphan">
+ <key update="true" foreign-key="company_customers">
+ <column name="`company_customers_e_id`" not-null="false" unique="false"/>
+ </key>
+ <list-index column="`company_customers_idx`"/>
+ <one-to-many entity-name="Customer"/>
+ </list>
+ <list name="purchaseOrders" lazy="true" cascade="all,delete-orphan">
+ <key update="true" foreign-key="company_purchaseorders">
+ <column name="`company_purchaseorders_e_id`" not-null="false" unique="false"/>
+ </key>
+ <list-index column="`company_purchaseorders_idx`"/>
+ <one-to-many entity-name="PurchaseOrder"/>
+ </list>
+ <list name="salesOrders" lazy="true" cascade="all,delete-orphan">
+ <key update="true" foreign-key="company_salesorders">
+ <column name="`company_salesorders_e_id`" not-null="false" unique="false"/>
+ </key>
+ <list-index column="`company_salesorders_idx`"/>
+ <one-to-many entity-name="SalesOrder"/>
+ </list>
+ </subclass>
+ <subclass entity-name="Supplier" abstract="false" lazy="false" extends="Address" discriminator-value="Supplier">
+ <meta attribute="eclassName">Supplier</meta>
+ <meta attribute="epackage">http://www.eclipse.org/emf/CDO/tests/model1/1.0.0</meta>
+ <tuplizer entity-mode="pojo" class="org.eclipse.emf.cdo.server.internal.hibernate.tuplizer.CDORevisionTuplizer"/>
+ <tuplizer entity-mode="dynamic-map" class="org.eclipse.emf.cdo.server.internal.hibernate.tuplizer.CDORevisionTuplizer"/>
+ <list name="purchaseOrders" lazy="true">
+ <key update="true">
+ <column name="`purchaseorder_supplier_e_id`" not-null="false" unique="false"/>
+ </key>
+ <list-index column="`supplier_purchaseorders_idx`"/>
+ <one-to-many entity-name="PurchaseOrder"/>
+ </list>
+ </subclass>
+ <subclass entity-name="Customer" abstract="false" lazy="false" extends="Address" discriminator-value="Customer">
+ <meta attribute="eclassName">Customer</meta>
+ <meta attribute="epackage">http://www.eclipse.org/emf/CDO/tests/model1/1.0.0</meta>
+ <tuplizer entity-mode="pojo" class="org.eclipse.emf.cdo.server.internal.hibernate.tuplizer.CDORevisionTuplizer"/>
+ <tuplizer entity-mode="dynamic-map" class="org.eclipse.emf.cdo.server.internal.hibernate.tuplizer.CDORevisionTuplizer"/>
+ <list name="salesOrders" lazy="true">
+ <key update="true">
+ <column name="`salesorder_customer_e_id`" not-null="false" unique="false"/>
+ </key>
+ <list-index column="`customer_salesorders_idx`"/>
+ <one-to-many entity-name="SalesOrder"/>
+ </list>
+ </subclass>
+ <class entity-name="Order" abstract="false" lazy="false" discriminator-value="Order" table="`order`">
+ <meta attribute="eclassName">Order</meta>
+ <meta attribute="epackage">http://www.eclipse.org/emf/CDO/tests/model1/1.0.0</meta>
+ <tuplizer entity-mode="pojo" class="org.eclipse.emf.cdo.server.internal.hibernate.tuplizer.CDORevisionTuplizer"/>
+ <tuplizer entity-mode="dynamic-map" class="org.eclipse.emf.cdo.server.internal.hibernate.tuplizer.CDORevisionTuplizer"/>
+ <id type="long" name="e_id" column="e_id" access="org.eclipse.emf.teneo.hibernate.mapping.identifier.IdentifierPropertyHandler">
+ <meta attribute="syntheticId">true</meta>
+ <generator class="native"/>
+ </id>
+ <discriminator column="`dtype`" type="string"/>
+ <version name="e_version" column="e_version" access="org.eclipse.emf.teneo.hibernate.mapping.property.VersionPropertyHandler">
+ <meta attribute="syntheticVersion">true</meta>
+ </version>
+ <list name="orderDetails" lazy="true" cascade="all,delete-orphan">
+ <key update="true">
+ <column name="`orderdetail_order_e_id`" not-null="false" unique="false"/>
+ </key>
+ <list-index column="`order_orderdetails_idx`"/>
+ <one-to-many entity-name="OrderDetail"/>
+ </list>
+ </class>
+ <class entity-name="OrderDetail" abstract="false" lazy="false" discriminator-value="OrderDetail" table="`orderdetail`">
+ <meta attribute="eclassName">OrderDetail</meta>
+ <meta attribute="epackage">http://www.eclipse.org/emf/CDO/tests/model1/1.0.0</meta>
+ <tuplizer entity-mode="pojo" class="org.eclipse.emf.cdo.server.internal.hibernate.tuplizer.CDORevisionTuplizer"/>
+ <tuplizer entity-mode="dynamic-map" class="org.eclipse.emf.cdo.server.internal.hibernate.tuplizer.CDORevisionTuplizer"/>
+ <id type="long" name="e_id" column="e_id" access="org.eclipse.emf.teneo.hibernate.mapping.identifier.IdentifierPropertyHandler">
+ <meta attribute="syntheticId">true</meta>
+ <generator class="native"/>
+ </id>
+ <discriminator column="`dtype`" type="string"/>
+ <version name="e_version" column="e_version" access="org.eclipse.emf.teneo.hibernate.mapping.property.VersionPropertyHandler">
+ <meta attribute="syntheticVersion">true</meta>
+ </version>
+ <many-to-one name="order" entity-name="Order" foreign-key="orderdetail_order" lazy="false" insert="false" update="false" not-null="false">
+ <column not-null="false" unique="false" name="`orderdetail_order_e_id`"/>
+ </many-to-one>
+ <many-to-one name="product" entity-name="Product" foreign-key="orderdetail_product" lazy="false" insert="false" update="false" not-null="false">
+ <column not-null="false" unique="false" name="`orderdetail_product_e_id`"/>
+ </many-to-one>
+ <property name="price" lazy="false" insert="true" update="true" not-null="false" unique="false" type="float">
+ <column not-null="false" unique="false" name="`price`"/>
+ </property>
+ </class>
+ <subclass entity-name="PurchaseOrder" abstract="false" lazy="false" extends="Order" discriminator-value="PurchaseOrder">
+ <meta attribute="eclassName">PurchaseOrder</meta>
+ <meta attribute="epackage">http://www.eclipse.org/emf/CDO/tests/model1/1.0.0</meta>
+ <tuplizer entity-mode="pojo" class="org.eclipse.emf.cdo.server.internal.hibernate.tuplizer.CDORevisionTuplizer"/>
+ <tuplizer entity-mode="dynamic-map" class="org.eclipse.emf.cdo.server.internal.hibernate.tuplizer.CDORevisionTuplizer"/>
+ <property name="date" lazy="false" insert="true" update="true" not-null="false" unique="false" type="timestamp">
+ <column not-null="false" unique="false" name="`date`"/>
+ </property>
+ <many-to-one name="supplier" entity-name="Supplier" foreign-key="purchaseorder_supplier" lazy="false" insert="false" update="false" not-null="false">
+ <column not-null="false" unique="false" name="`purchaseorder_supplier_e_id`"/>
+ </many-to-one>
+ </subclass>
+ <subclass entity-name="SalesOrder" abstract="false" lazy="false" extends="Order" discriminator-value="SalesOrder">
+ <meta attribute="eclassName">SalesOrder</meta>
+ <meta attribute="epackage">http://www.eclipse.org/emf/CDO/tests/model1/1.0.0</meta>
+ <tuplizer entity-mode="pojo" class="org.eclipse.emf.cdo.server.internal.hibernate.tuplizer.CDORevisionTuplizer"/>
+ <tuplizer entity-mode="dynamic-map" class="org.eclipse.emf.cdo.server.internal.hibernate.tuplizer.CDORevisionTuplizer"/>
+ <property name="id" lazy="false" insert="true" update="true" not-null="false" unique="false" type="int">
+ <column not-null="false" unique="false" name="`id`"/>
+ </property>
+ <many-to-one name="customer" entity-name="Customer" foreign-key="salesorder_customer" lazy="false" insert="false" update="false" not-null="false">
+ <column not-null="false" unique="false" name="`salesorder_customer_e_id`"/>
+ </many-to-one>
+ </subclass>
+ <class entity-name="Category" abstract="false" lazy="false" discriminator-value="Category" table="`category`">
+ <meta attribute="eclassName">Category</meta>
+ <meta attribute="epackage">http://www.eclipse.org/emf/CDO/tests/model1/1.0.0</meta>
+ <tuplizer entity-mode="pojo" class="org.eclipse.emf.cdo.server.internal.hibernate.tuplizer.CDORevisionTuplizer"/>
+ <tuplizer entity-mode="dynamic-map" class="org.eclipse.emf.cdo.server.internal.hibernate.tuplizer.CDORevisionTuplizer"/>
+ <id type="long" name="e_id" column="e_id" access="org.eclipse.emf.teneo.hibernate.mapping.identifier.IdentifierPropertyHandler">
+ <meta attribute="syntheticId">true</meta>
+ <generator class="native"/>
+ </id>
+ <discriminator column="`dtype`" type="string"/>
+ <version name="e_version" column="e_version" access="org.eclipse.emf.teneo.hibernate.mapping.property.VersionPropertyHandler">
+ <meta attribute="syntheticVersion">true</meta>
+ </version>
+ <property name="name" lazy="false" insert="true" update="true" not-null="false" unique="false" type="java.lang.String">
+ <column not-null="false" unique="false" name="`name`"/>
+ </property>
+ <list name="categories" lazy="true" cascade="all,delete-orphan">
+ <key update="true" foreign-key="category_categories">
+ <column name="`category_categories_e_id`" not-null="false" unique="false"/>
+ </key>
+ <list-index column="`category_categories_idx`"/>
+ <one-to-many entity-name="Category"/>
+ </list>
+ <list name="products" lazy="true" cascade="all,delete-orphan">
+ <key update="true" foreign-key="category_products">
+ <column name="`category_products_e_id`" not-null="false" unique="false"/>
+ </key>
+ <list-index column="`category_products_idx`"/>
+ <one-to-many entity-name="Product"/>
+ </list>
+ </class>
+ <class entity-name="Product" abstract="false" lazy="false" discriminator-value="Product" table="`product`">
+ <meta attribute="eclassName">Product</meta>
+ <meta attribute="epackage">http://www.eclipse.org/emf/CDO/tests/model1/1.0.0</meta>
+ <tuplizer entity-mode="pojo" class="org.eclipse.emf.cdo.server.internal.hibernate.tuplizer.CDORevisionTuplizer"/>
+ <tuplizer entity-mode="dynamic-map" class="org.eclipse.emf.cdo.server.internal.hibernate.tuplizer.CDORevisionTuplizer"/>
+ <id type="long" name="e_id" column="e_id" access="org.eclipse.emf.teneo.hibernate.mapping.identifier.IdentifierPropertyHandler">
+ <meta attribute="syntheticId">true</meta>
+ <generator class="native"/>
+ </id>
+ <discriminator column="`dtype`" type="string"/>
+ <version name="e_version" column="e_version" access="org.eclipse.emf.teneo.hibernate.mapping.property.VersionPropertyHandler">
+ <meta attribute="syntheticVersion">true</meta>
+ </version>
+ <property name="name" lazy="false" insert="true" update="true" not-null="false" unique="false" type="java.lang.String">
+ <column not-null="false" unique="false" name="`name`"/>
+ </property>
+ <list name="orderDetails" lazy="true">
+ <key update="true">
+ <column name="`orderdetail_product_e_id`" not-null="false" unique="false"/>
+ </key>
+ <list-index column="`product_orderdetails_idx`"/>
+ <one-to-many entity-name="OrderDetail"/>
+ </list>
+ </class>
+</hibernate-mapping>
diff --git a/plugins/org.eclipse.emf.cdo.server.hibernate/mappings/resource.hbm.xml b/plugins/org.eclipse.emf.cdo.server.hibernate/mappings/resource.hbm.xml
new file mode 100644
index 0000000000..2f67dcf344
--- /dev/null
+++ b/plugins/org.eclipse.emf.cdo.server.hibernate/mappings/resource.hbm.xml
@@ -0,0 +1,28 @@
+<?xml version="1.0"?>
+<!DOCTYPE hibernate-mapping SYSTEM "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
+<hibernate-mapping auto-import="false">
+ <class entity-name="CDOResource" abstract="false" lazy="false" discriminator-value="cdoresource" table="`cdo_resources`">
+ <meta attribute="eclassName">CDOResource</meta>
+ <meta attribute="epackage">http://www.eclipse.org/emf/CDO/resource/1.0.0</meta>
+ <tuplizer entity-mode="pojo" class="org.eclipse.emf.cdo.server.internal.hibernate.tuplizer.CDORevisionTuplizer"/>
+ <tuplizer entity-mode="dynamic-map" class="org.eclipse.emf.cdo.server.internal.hibernate.tuplizer.CDORevisionTuplizer"/>
+ <id type="long" name="e_id" column="e_id">
+ <meta attribute="syntheticId">true</meta>
+ <generator class="native"/>
+ </id>
+ <discriminator column="`dtype`" type="string"/>
+ <version name="e_version" column="e_version">
+ <meta attribute="syntheticVersion">true</meta>
+ </version>
+ <property name="path" type="string" not-null="true" length="255" />
+ <list name="contents" lazy="true" cascade="all,delete-orphan">
+ <key/>
+ <list-index/>
+ <element type="org.eclipse.emf.cdo.server.internal.hibernate.tuplizer.CDOIDUserType">
+ <column name="entityName"/>
+ <column name="idString"/>
+ <column name="idBinary" length="1000"/>
+ </element>
+ </list>
+ </class>
+</hibernate-mapping>

Back to the top