Skip to main content
aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authormtaal2008-08-03 19:24:32 +0000
committermtaal2008-08-03 19:24:32 +0000
commit5af21438079befe0aeffdc0c406e33ba14af717a (patch)
treefbfaa9ffa2eaf72bfe7fa133e71a9fe3d785101b /tests
parent3db2d2c6e0a467492e724947ebc6acb446add708 (diff)
downloadorg.eclipse.emf.teneo-5af21438079befe0aeffdc0c406e33ba14af717a.tar.gz
org.eclipse.emf.teneo-5af21438079befe0aeffdc0c406e33ba14af717a.tar.xz
org.eclipse.emf.teneo-5af21438079befe0aeffdc0c406e33ba14af717a.zip
[242995]
Diffstat (limited to 'tests')
-rw-r--r--tests/org.eclipse.emf.teneo.hibernate.test/hbm/org.eclipse.emf.teneo.hibernate.test.issues/Bz242995Action_mysql_a_o_hibernate.hbm.xml117
-rw-r--r--tests/org.eclipse.emf.teneo.hibernate.test/hbm/org.eclipse.emf.teneo.hibernate.test.issues/Bz242995Action_mysql_e_o_hibernate.hbm.xml112
-rw-r--r--tests/org.eclipse.emf.teneo.hibernate.test/hbm/org.eclipse.emf.teneo.hibernate.test.issues/Bz242995Action_mysql_s_o_hibernate.hbm.xml112
-rw-r--r--tests/org.eclipse.emf.teneo.hibernate.test/hbm/org.eclipse.emf.teneo.test.emf.annotations/ToOneAction_mysql_a_o_hibernate.hbm.xml2
-rw-r--r--tests/org.eclipse.emf.teneo.hibernate.test/hbm/org.eclipse.emf.teneo.test.emf.annotations/ToOneAction_mysql_e_o_hibernate.hbm.xml2
-rw-r--r--tests/org.eclipse.emf.teneo.hibernate.test/hbm/org.eclipse.emf.teneo.test.emf.annotations/ToOneAction_mysql_s_o_hibernate.hbm.xml2
-rw-r--r--tests/org.eclipse.emf.teneo.hibernate.test/hbm/org.eclipse.emf.teneo.test.emf.annotations/ToOneAction_mysql_xjoin_hibernate.hbm.xml2
-rw-r--r--tests/org.eclipse.emf.teneo.hibernate.test/hbm/org.eclipse.emf.teneo.test.emf.annotations/ToOneAction_mysql_xsingle_hibernate.hbm.xml2
-rw-r--r--tests/org.eclipse.emf.teneo.hibernate.test/hbm/org.eclipse.emf.teneo.test.emf.relation/Relation1to1Action_mysql_a_o_hibernate.hbm.xml6
-rw-r--r--tests/org.eclipse.emf.teneo.hibernate.test/hbm/org.eclipse.emf.teneo.test.emf.relation/Relation1to1Action_mysql_e_o_hibernate.hbm.xml6
-rw-r--r--tests/org.eclipse.emf.teneo.hibernate.test/hbm/org.eclipse.emf.teneo.test.emf.relation/Relation1to1Action_mysql_s_o_hibernate.hbm.xml6
-rw-r--r--tests/org.eclipse.emf.teneo.hibernate.test/src/org/eclipse/emf/teneo/hibernate/test/issues/AllTests.java3
-rw-r--r--tests/org.eclipse.emf.teneo.hibernate.test/src/org/eclipse/emf/teneo/hibernate/test/issues/Bz242995Action.java92
13 files changed, 449 insertions, 15 deletions
diff --git a/tests/org.eclipse.emf.teneo.hibernate.test/hbm/org.eclipse.emf.teneo.hibernate.test.issues/Bz242995Action_mysql_a_o_hibernate.hbm.xml b/tests/org.eclipse.emf.teneo.hibernate.test/hbm/org.eclipse.emf.teneo.hibernate.test.issues/Bz242995Action_mysql_a_o_hibernate.hbm.xml
new file mode 100644
index 000000000..f65eae292
--- /dev/null
+++ b/tests/org.eclipse.emf.teneo.hibernate.test/hbm/org.eclipse.emf.teneo.hibernate.test.issues/Bz242995Action_mysql_a_o_hibernate.hbm.xml
@@ -0,0 +1,117 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN" "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
+
+<hibernate-mapping auto-import="false">
+ <class name="org.eclipse.emf.teneo.samples.issues.bz242995.impl.BookImpl" entity-name="Book" abstract="false" lazy="true" discriminator-value="Book" table="`book`" proxy="org.eclipse.emf.teneo.samples.issues.bz242995.Book">
+ <meta attribute="eclassName">Book</meta>
+ <meta attribute="epackage">http:///org/eclipse/example/library.ecore</meta>
+ <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="title" lazy="false" insert="true" update="true" not-null="false" unique="false" type="java.lang.String">
+ <column not-null="false" unique="false" name="`title`"/>
+ </property>
+ <property name="pages" lazy="false" insert="true" update="true" not-null="false" unique="false" type="int">
+ <column not-null="false" unique="false" name="`pages`"/>
+ </property>
+ <property name="category" lazy="false" not-null="false" insert="true" update="true" unique="false">
+ <column not-null="false" unique="false" name="`category`"/>
+ <type name="org.eclipse.emf.teneo.hibernate.mapping.ENumUserType">
+ <param name="enumClass">org.eclipse.emf.teneo.samples.issues.bz242995.BookCategory</param>
+ </type>
+ </property>
+ <many-to-one name="author" entity-name="Writer" cascade="merge,persist,save-update,lock,refresh" foreign-key="book_author" lazy="proxy" insert="false" update="false" not-null="false">
+ <column not-null="false" unique="false" name="`book_author_e_id`"/>
+ </many-to-one>
+ </class>
+ <class name="org.eclipse.emf.teneo.samples.issues.bz242995.impl.LibraryImpl" entity-name="Library" abstract="false" lazy="true" discriminator-value="Library" table="`library`" proxy="org.eclipse.emf.teneo.samples.issues.bz242995.Library">
+ <meta attribute="eclassName">Library</meta>
+ <meta attribute="epackage">http:///org/eclipse/example/library.ecore</meta>
+ <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="writers" lazy="true" cascade="all,delete-orphan">
+ <key update="true" foreign-key="library_writers">
+ <column name="`library_writers_e_id`" not-null="false" unique="false"/>
+ </key>
+ <list-index column="`library_writers_idx`"/>
+ <one-to-many entity-name="Writer"/>
+ </list>
+ <list name="books" lazy="true" cascade="all,delete-orphan">
+ <key update="true" foreign-key="library_books">
+ <column name="`library_books_e_id`" not-null="false" unique="false"/>
+ </key>
+ <list-index column="`library_books_idx`"/>
+ <one-to-many entity-name="Book"/>
+ </list>
+ </class>
+ <class name="org.eclipse.emf.teneo.samples.issues.bz242995.impl.WriterImpl" entity-name="Writer" abstract="false" lazy="true" discriminator-value="Writer" table="`writer`" proxy="org.eclipse.emf.teneo.samples.issues.bz242995.Writer">
+ <meta attribute="eclassName">Writer</meta>
+ <meta attribute="epackage">http:///org/eclipse/example/library.ecore</meta>
+ <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="books" lazy="true" cascade="merge,persist,save-update,lock,refresh">
+ <key update="true">
+ <column name="`book_author_e_id`" not-null="false" unique="false"/>
+ </key>
+ <list-index column="`writer_books_idx`"/>
+ <one-to-many entity-name="Book"/>
+ </list>
+ </class>
+ <class name="org.eclipse.emf.teneo.samples.issues.bz242995.impl.OneTimeWonderImpl" entity-name="OneTimeWonder" abstract="false" lazy="true" discriminator-value="OneTimeWonder" table="`onetimewonder`" proxy="org.eclipse.emf.teneo.samples.issues.bz242995.OneTimeWonder">
+ <meta attribute="eclassName">OneTimeWonder</meta>
+ <meta attribute="epackage">http:///org/eclipse/example/library.ecore</meta>
+ <id name="id" type="long" unsaved-value="0">
+ <column not-null="true" unique="false" name="`id`"/>
+ <generator class="foreign">
+ <param name="property">theAuthor</param>
+ </generator>
+ </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>
+ <one-to-one name="theAuthor" entity-name="Author" cascade="merge,persist,save-update,lock,refresh" lazy="proxy" constrained="true"/>
+ </class>
+ <class name="org.eclipse.emf.teneo.samples.issues.bz242995.impl.AuthorImpl" entity-name="Author" abstract="false" lazy="true" discriminator-value="Author" table="`author`" proxy="org.eclipse.emf.teneo.samples.issues.bz242995.Author">
+ <meta attribute="eclassName">Author</meta>
+ <meta attribute="epackage">http:///org/eclipse/example/library.ecore</meta>
+ <id name="id" type="long" unsaved-value="0">
+ <column not-null="true" unique="false" name="`id`"/>
+ <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>
+ <one-to-one name="theBook" entity-name="OneTimeWonder" cascade="merge,persist,save-update,lock,refresh" lazy="proxy"/>
+ </class>
+</hibernate-mapping> \ No newline at end of file
diff --git a/tests/org.eclipse.emf.teneo.hibernate.test/hbm/org.eclipse.emf.teneo.hibernate.test.issues/Bz242995Action_mysql_e_o_hibernate.hbm.xml b/tests/org.eclipse.emf.teneo.hibernate.test/hbm/org.eclipse.emf.teneo.hibernate.test.issues/Bz242995Action_mysql_e_o_hibernate.hbm.xml
new file mode 100644
index 000000000..19c741ce3
--- /dev/null
+++ b/tests/org.eclipse.emf.teneo.hibernate.test/hbm/org.eclipse.emf.teneo.hibernate.test.issues/Bz242995Action_mysql_e_o_hibernate.hbm.xml
@@ -0,0 +1,112 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN" "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
+
+<hibernate-mapping auto-import="false">
+ <class name="org.eclipse.emf.teneo.samples.issues.bz242995.impl.BookImpl" entity-name="Book" abstract="false" lazy="true" table="`book`" proxy="org.eclipse.emf.teneo.samples.issues.bz242995.Book">
+ <meta attribute="eclassName">Book</meta>
+ <meta attribute="epackage">http:///org/eclipse/example/library.ecore</meta>
+ <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>
+ <version name="e_version" column="e_version" access="org.eclipse.emf.teneo.hibernate.mapping.property.VersionPropertyHandler">
+ <meta attribute="syntheticVersion">true</meta>
+ </version>
+ <property name="title" lazy="false" insert="true" update="true" not-null="false" unique="false" type="java.lang.String">
+ <column not-null="false" unique="false" name="`title`"/>
+ </property>
+ <property name="pages" lazy="false" insert="true" update="true" not-null="false" unique="false" type="int">
+ <column not-null="false" unique="false" name="`pages`"/>
+ </property>
+ <property name="category" lazy="false" not-null="false" insert="true" update="true" unique="false">
+ <column not-null="false" unique="false" name="`category`"/>
+ <type name="org.eclipse.emf.teneo.hibernate.mapping.ENumUserType">
+ <param name="enumClass">org.eclipse.emf.teneo.samples.issues.bz242995.BookCategory</param>
+ </type>
+ </property>
+ <many-to-one name="author" entity-name="Writer" cascade="merge,persist,save-update,lock,refresh" foreign-key="book_author" lazy="proxy" insert="false" update="false" not-null="false">
+ <column not-null="false" unique="false" name="`book_author_e_id`"/>
+ </many-to-one>
+ </class>
+ <class name="org.eclipse.emf.teneo.samples.issues.bz242995.impl.LibraryImpl" entity-name="Library" abstract="false" lazy="true" table="`library`" proxy="org.eclipse.emf.teneo.samples.issues.bz242995.Library">
+ <meta attribute="eclassName">Library</meta>
+ <meta attribute="epackage">http:///org/eclipse/example/library.ecore</meta>
+ <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>
+ <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="writers" lazy="true" cascade="all,delete-orphan">
+ <key update="true" foreign-key="library_writers">
+ <column name="`library_writers_e_id`" not-null="false" unique="false"/>
+ </key>
+ <list-index column="`library_writers_idx`"/>
+ <one-to-many entity-name="Writer"/>
+ </list>
+ <list name="books" lazy="true" cascade="all,delete-orphan">
+ <key update="true" foreign-key="library_books">
+ <column name="`library_books_e_id`" not-null="false" unique="false"/>
+ </key>
+ <list-index column="`library_books_idx`"/>
+ <one-to-many entity-name="Book"/>
+ </list>
+ </class>
+ <class name="org.eclipse.emf.teneo.samples.issues.bz242995.impl.WriterImpl" entity-name="Writer" abstract="false" lazy="true" table="`writer`" proxy="org.eclipse.emf.teneo.samples.issues.bz242995.Writer">
+ <meta attribute="eclassName">Writer</meta>
+ <meta attribute="epackage">http:///org/eclipse/example/library.ecore</meta>
+ <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>
+ <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="books" lazy="true" cascade="merge,persist,save-update,lock,refresh">
+ <key update="true">
+ <column name="`book_author_e_id`" not-null="false" unique="false"/>
+ </key>
+ <list-index column="`writer_books_idx`"/>
+ <one-to-many entity-name="Book"/>
+ </list>
+ </class>
+ <class name="org.eclipse.emf.teneo.samples.issues.bz242995.impl.OneTimeWonderImpl" entity-name="OneTimeWonder" abstract="false" lazy="true" table="`onetimewonder`" proxy="org.eclipse.emf.teneo.samples.issues.bz242995.OneTimeWonder">
+ <meta attribute="eclassName">OneTimeWonder</meta>
+ <meta attribute="epackage">http:///org/eclipse/example/library.ecore</meta>
+ <id name="id" type="long" unsaved-value="0">
+ <column not-null="true" unique="false" name="`id`"/>
+ <generator class="foreign">
+ <param name="property">theAuthor</param>
+ </generator>
+ </id>
+ <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>
+ <one-to-one name="theAuthor" entity-name="Author" cascade="merge,persist,save-update,lock,refresh" lazy="proxy" constrained="true"/>
+ </class>
+ <class name="org.eclipse.emf.teneo.samples.issues.bz242995.impl.AuthorImpl" entity-name="Author" abstract="false" lazy="true" table="`author`" proxy="org.eclipse.emf.teneo.samples.issues.bz242995.Author">
+ <meta attribute="eclassName">Author</meta>
+ <meta attribute="epackage">http:///org/eclipse/example/library.ecore</meta>
+ <id name="id" type="long" unsaved-value="0">
+ <column not-null="true" unique="false" name="`id`"/>
+ <generator class="native"/>
+ </id>
+ <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>
+ <one-to-one name="theBook" entity-name="OneTimeWonder" cascade="merge,persist,save-update,lock,refresh" lazy="proxy"/>
+ </class>
+</hibernate-mapping> \ No newline at end of file
diff --git a/tests/org.eclipse.emf.teneo.hibernate.test/hbm/org.eclipse.emf.teneo.hibernate.test.issues/Bz242995Action_mysql_s_o_hibernate.hbm.xml b/tests/org.eclipse.emf.teneo.hibernate.test/hbm/org.eclipse.emf.teneo.hibernate.test.issues/Bz242995Action_mysql_s_o_hibernate.hbm.xml
new file mode 100644
index 000000000..19c741ce3
--- /dev/null
+++ b/tests/org.eclipse.emf.teneo.hibernate.test/hbm/org.eclipse.emf.teneo.hibernate.test.issues/Bz242995Action_mysql_s_o_hibernate.hbm.xml
@@ -0,0 +1,112 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN" "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
+
+<hibernate-mapping auto-import="false">
+ <class name="org.eclipse.emf.teneo.samples.issues.bz242995.impl.BookImpl" entity-name="Book" abstract="false" lazy="true" table="`book`" proxy="org.eclipse.emf.teneo.samples.issues.bz242995.Book">
+ <meta attribute="eclassName">Book</meta>
+ <meta attribute="epackage">http:///org/eclipse/example/library.ecore</meta>
+ <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>
+ <version name="e_version" column="e_version" access="org.eclipse.emf.teneo.hibernate.mapping.property.VersionPropertyHandler">
+ <meta attribute="syntheticVersion">true</meta>
+ </version>
+ <property name="title" lazy="false" insert="true" update="true" not-null="false" unique="false" type="java.lang.String">
+ <column not-null="false" unique="false" name="`title`"/>
+ </property>
+ <property name="pages" lazy="false" insert="true" update="true" not-null="false" unique="false" type="int">
+ <column not-null="false" unique="false" name="`pages`"/>
+ </property>
+ <property name="category" lazy="false" not-null="false" insert="true" update="true" unique="false">
+ <column not-null="false" unique="false" name="`category`"/>
+ <type name="org.eclipse.emf.teneo.hibernate.mapping.ENumUserType">
+ <param name="enumClass">org.eclipse.emf.teneo.samples.issues.bz242995.BookCategory</param>
+ </type>
+ </property>
+ <many-to-one name="author" entity-name="Writer" cascade="merge,persist,save-update,lock,refresh" foreign-key="book_author" lazy="proxy" insert="false" update="false" not-null="false">
+ <column not-null="false" unique="false" name="`book_author_e_id`"/>
+ </many-to-one>
+ </class>
+ <class name="org.eclipse.emf.teneo.samples.issues.bz242995.impl.LibraryImpl" entity-name="Library" abstract="false" lazy="true" table="`library`" proxy="org.eclipse.emf.teneo.samples.issues.bz242995.Library">
+ <meta attribute="eclassName">Library</meta>
+ <meta attribute="epackage">http:///org/eclipse/example/library.ecore</meta>
+ <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>
+ <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="writers" lazy="true" cascade="all,delete-orphan">
+ <key update="true" foreign-key="library_writers">
+ <column name="`library_writers_e_id`" not-null="false" unique="false"/>
+ </key>
+ <list-index column="`library_writers_idx`"/>
+ <one-to-many entity-name="Writer"/>
+ </list>
+ <list name="books" lazy="true" cascade="all,delete-orphan">
+ <key update="true" foreign-key="library_books">
+ <column name="`library_books_e_id`" not-null="false" unique="false"/>
+ </key>
+ <list-index column="`library_books_idx`"/>
+ <one-to-many entity-name="Book"/>
+ </list>
+ </class>
+ <class name="org.eclipse.emf.teneo.samples.issues.bz242995.impl.WriterImpl" entity-name="Writer" abstract="false" lazy="true" table="`writer`" proxy="org.eclipse.emf.teneo.samples.issues.bz242995.Writer">
+ <meta attribute="eclassName">Writer</meta>
+ <meta attribute="epackage">http:///org/eclipse/example/library.ecore</meta>
+ <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>
+ <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="books" lazy="true" cascade="merge,persist,save-update,lock,refresh">
+ <key update="true">
+ <column name="`book_author_e_id`" not-null="false" unique="false"/>
+ </key>
+ <list-index column="`writer_books_idx`"/>
+ <one-to-many entity-name="Book"/>
+ </list>
+ </class>
+ <class name="org.eclipse.emf.teneo.samples.issues.bz242995.impl.OneTimeWonderImpl" entity-name="OneTimeWonder" abstract="false" lazy="true" table="`onetimewonder`" proxy="org.eclipse.emf.teneo.samples.issues.bz242995.OneTimeWonder">
+ <meta attribute="eclassName">OneTimeWonder</meta>
+ <meta attribute="epackage">http:///org/eclipse/example/library.ecore</meta>
+ <id name="id" type="long" unsaved-value="0">
+ <column not-null="true" unique="false" name="`id`"/>
+ <generator class="foreign">
+ <param name="property">theAuthor</param>
+ </generator>
+ </id>
+ <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>
+ <one-to-one name="theAuthor" entity-name="Author" cascade="merge,persist,save-update,lock,refresh" lazy="proxy" constrained="true"/>
+ </class>
+ <class name="org.eclipse.emf.teneo.samples.issues.bz242995.impl.AuthorImpl" entity-name="Author" abstract="false" lazy="true" table="`author`" proxy="org.eclipse.emf.teneo.samples.issues.bz242995.Author">
+ <meta attribute="eclassName">Author</meta>
+ <meta attribute="epackage">http:///org/eclipse/example/library.ecore</meta>
+ <id name="id" type="long" unsaved-value="0">
+ <column not-null="true" unique="false" name="`id`"/>
+ <generator class="native"/>
+ </id>
+ <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>
+ <one-to-one name="theBook" entity-name="OneTimeWonder" cascade="merge,persist,save-update,lock,refresh" lazy="proxy"/>
+ </class>
+</hibernate-mapping> \ No newline at end of file
diff --git a/tests/org.eclipse.emf.teneo.hibernate.test/hbm/org.eclipse.emf.teneo.test.emf.annotations/ToOneAction_mysql_a_o_hibernate.hbm.xml b/tests/org.eclipse.emf.teneo.hibernate.test/hbm/org.eclipse.emf.teneo.test.emf.annotations/ToOneAction_mysql_a_o_hibernate.hbm.xml
index 3d06126fb..803344711 100644
--- a/tests/org.eclipse.emf.teneo.hibernate.test/hbm/org.eclipse.emf.teneo.test.emf.annotations/ToOneAction_mysql_a_o_hibernate.hbm.xml
+++ b/tests/org.eclipse.emf.teneo.hibernate.test/hbm/org.eclipse.emf.teneo.test.emf.annotations/ToOneAction_mysql_a_o_hibernate.hbm.xml
@@ -62,7 +62,7 @@
<many-to-one name="address" entity-name="Address" cascade="merge,persist,save-update,lock,refresh" foreign-key="person_address" lazy="false" insert="true" update="true" not-null="false">
<column not-null="false" unique="false" name="`address_address_e_id`"/>
</many-to-one>
- <one-to-one name="head" entity-name="Head" cascade="all" property-ref="person" lazy="false"/>
+ <one-to-one name="head" entity-name="Head" cascade="all" lazy="false"/>
<many-to-one name="leftArm" entity-name="Arm" foreign-key="person_leftarm" lazy="false" insert="true" update="true"/>
</class>
</hibernate-mapping> \ No newline at end of file
diff --git a/tests/org.eclipse.emf.teneo.hibernate.test/hbm/org.eclipse.emf.teneo.test.emf.annotations/ToOneAction_mysql_e_o_hibernate.hbm.xml b/tests/org.eclipse.emf.teneo.hibernate.test/hbm/org.eclipse.emf.teneo.test.emf.annotations/ToOneAction_mysql_e_o_hibernate.hbm.xml
index bb6e9638f..6d88fe892 100644
--- a/tests/org.eclipse.emf.teneo.hibernate.test/hbm/org.eclipse.emf.teneo.test.emf.annotations/ToOneAction_mysql_e_o_hibernate.hbm.xml
+++ b/tests/org.eclipse.emf.teneo.hibernate.test/hbm/org.eclipse.emf.teneo.test.emf.annotations/ToOneAction_mysql_e_o_hibernate.hbm.xml
@@ -58,7 +58,7 @@
<many-to-one name="address" entity-name="Address" cascade="merge,persist,save-update,lock,refresh" foreign-key="person_address" lazy="false" insert="true" update="true" not-null="false">
<column not-null="false" unique="false" name="`address_address_e_id`"/>
</many-to-one>
- <one-to-one name="head" entity-name="Head" cascade="all" property-ref="person" lazy="false"/>
+ <one-to-one name="head" entity-name="Head" cascade="all" lazy="false"/>
<many-to-one name="leftArm" entity-name="Arm" foreign-key="person_leftarm" lazy="false" insert="true" update="true"/>
</class>
</hibernate-mapping> \ No newline at end of file
diff --git a/tests/org.eclipse.emf.teneo.hibernate.test/hbm/org.eclipse.emf.teneo.test.emf.annotations/ToOneAction_mysql_s_o_hibernate.hbm.xml b/tests/org.eclipse.emf.teneo.hibernate.test/hbm/org.eclipse.emf.teneo.test.emf.annotations/ToOneAction_mysql_s_o_hibernate.hbm.xml
index bb6e9638f..6d88fe892 100644
--- a/tests/org.eclipse.emf.teneo.hibernate.test/hbm/org.eclipse.emf.teneo.test.emf.annotations/ToOneAction_mysql_s_o_hibernate.hbm.xml
+++ b/tests/org.eclipse.emf.teneo.hibernate.test/hbm/org.eclipse.emf.teneo.test.emf.annotations/ToOneAction_mysql_s_o_hibernate.hbm.xml
@@ -58,7 +58,7 @@
<many-to-one name="address" entity-name="Address" cascade="merge,persist,save-update,lock,refresh" foreign-key="person_address" lazy="false" insert="true" update="true" not-null="false">
<column not-null="false" unique="false" name="`address_address_e_id`"/>
</many-to-one>
- <one-to-one name="head" entity-name="Head" cascade="all" property-ref="person" lazy="false"/>
+ <one-to-one name="head" entity-name="Head" cascade="all" lazy="false"/>
<many-to-one name="leftArm" entity-name="Arm" foreign-key="person_leftarm" lazy="false" insert="true" update="true"/>
</class>
</hibernate-mapping> \ No newline at end of file
diff --git a/tests/org.eclipse.emf.teneo.hibernate.test/hbm/org.eclipse.emf.teneo.test.emf.annotations/ToOneAction_mysql_xjoin_hibernate.hbm.xml b/tests/org.eclipse.emf.teneo.hibernate.test/hbm/org.eclipse.emf.teneo.test.emf.annotations/ToOneAction_mysql_xjoin_hibernate.hbm.xml
index 81d32b705..68ff51fa6 100644
--- a/tests/org.eclipse.emf.teneo.hibernate.test/hbm/org.eclipse.emf.teneo.test.emf.annotations/ToOneAction_mysql_xjoin_hibernate.hbm.xml
+++ b/tests/org.eclipse.emf.teneo.hibernate.test/hbm/org.eclipse.emf.teneo.test.emf.annotations/ToOneAction_mysql_xjoin_hibernate.hbm.xml
@@ -58,7 +58,7 @@
<many-to-one name="address" entity-name="Address" cascade="merge,persist,save-update,lock,refresh" foreign-key="person_address" lazy="false" insert="true" update="true" not-null="false">
<column not-null="false" unique="false" name="`address_address_e_id`"/>
</many-to-one>
- <one-to-one name="head" entity-name="Head" cascade="all" property-ref="person" lazy="false"/>
+ <one-to-one name="head" entity-name="Head" cascade="all" lazy="false"/>
<many-to-one name="leftArm" entity-name="Arm" cascade="merge,persist,save-update,lock,refresh" foreign-key="person_leftarm" lazy="false" insert="true" update="true" not-null="true">
<column not-null="true" unique="false" name="`arm_leftarm_e_id`"/>
</many-to-one>
diff --git a/tests/org.eclipse.emf.teneo.hibernate.test/hbm/org.eclipse.emf.teneo.test.emf.annotations/ToOneAction_mysql_xsingle_hibernate.hbm.xml b/tests/org.eclipse.emf.teneo.hibernate.test/hbm/org.eclipse.emf.teneo.test.emf.annotations/ToOneAction_mysql_xsingle_hibernate.hbm.xml
index e0386e72c..2f413b382 100644
--- a/tests/org.eclipse.emf.teneo.hibernate.test/hbm/org.eclipse.emf.teneo.test.emf.annotations/ToOneAction_mysql_xsingle_hibernate.hbm.xml
+++ b/tests/org.eclipse.emf.teneo.hibernate.test/hbm/org.eclipse.emf.teneo.test.emf.annotations/ToOneAction_mysql_xsingle_hibernate.hbm.xml
@@ -62,7 +62,7 @@
<many-to-one name="address" entity-name="Address" cascade="merge,persist,save-update,lock,refresh" foreign-key="person_address" lazy="false" insert="true" update="true" not-null="false">
<column not-null="false" unique="false" name="`address_address_e_id`"/>
</many-to-one>
- <one-to-one name="head" entity-name="Head" cascade="all" property-ref="person" lazy="false"/>
+ <one-to-one name="head" entity-name="Head" cascade="all" lazy="false"/>
<many-to-one name="leftArm" entity-name="Arm" cascade="merge,persist,save-update,lock,refresh" foreign-key="person_leftarm" lazy="false" insert="true" update="true" not-null="true">
<column not-null="true" unique="false" name="`arm_leftarm_e_id`"/>
</many-to-one>
diff --git a/tests/org.eclipse.emf.teneo.hibernate.test/hbm/org.eclipse.emf.teneo.test.emf.relation/Relation1to1Action_mysql_a_o_hibernate.hbm.xml b/tests/org.eclipse.emf.teneo.hibernate.test/hbm/org.eclipse.emf.teneo.test.emf.relation/Relation1to1Action_mysql_a_o_hibernate.hbm.xml
index f04112f17..0bbb7cfbf 100644
--- a/tests/org.eclipse.emf.teneo.hibernate.test/hbm/org.eclipse.emf.teneo.test.emf.relation/Relation1to1Action_mysql_a_o_hibernate.hbm.xml
+++ b/tests/org.eclipse.emf.teneo.hibernate.test/hbm/org.eclipse.emf.teneo.test.emf.relation/Relation1to1Action_mysql_a_o_hibernate.hbm.xml
@@ -91,7 +91,7 @@
<property name="name" lazy="false" insert="true" update="true" not-null="true" unique="false" type="java.lang.String">
<column not-null="true" unique="false" name="`name`"/>
</property>
- <one-to-one name="main" entity-name="Main" cascade="merge,persist,save-update,lock,refresh" property-ref="notcontainedtwowaynotrequired" lazy="false"/>
+ <one-to-one name="main" entity-name="Main" cascade="merge,persist,save-update,lock,refresh" lazy="false"/>
</class>
<class name="org.eclipse.emf.teneo.samples.emf.relation.relation1to1.impl.NotContainedChildNRTNRImpl" entity-name="NotContainedChildNRTNR" abstract="false" lazy="false" discriminator-value="NotContainedChildNRTNR" table="`notcontainedchildnrtnr`">
<meta attribute="eclassName">NotContainedChildNRTNR</meta>
@@ -107,7 +107,7 @@
<property name="name" lazy="false" insert="true" update="true" not-null="true" unique="false" type="java.lang.String">
<column not-null="true" unique="false" name="`name`"/>
</property>
- <one-to-one name="main" entity-name="Main" cascade="merge,persist,save-update,lock,refresh" property-ref="notcontainedtwowaynotrequirednr" lazy="false"/>
+ <one-to-one name="main" entity-name="Main" cascade="merge,persist,save-update,lock,refresh" lazy="false"/>
</class>
<class name="org.eclipse.emf.teneo.samples.emf.relation.relation1to1.impl.NotContainedChildRImpl" entity-name="NotContainedChildR" abstract="false" lazy="false" discriminator-value="NotContainedChildR" table="`notcontainedchildr`">
<meta attribute="eclassName">NotContainedChildR</meta>
@@ -138,6 +138,6 @@
<property name="name" lazy="false" insert="true" update="true" not-null="true" unique="false" type="java.lang.String">
<column not-null="true" unique="false" name="`name`"/>
</property>
- <one-to-one name="main" entity-name="Main" cascade="merge,persist,save-update,lock,refresh" property-ref="notcontainedtwowayrequirednr" lazy="false"/>
+ <one-to-one name="main" entity-name="Main" cascade="merge,persist,save-update,lock,refresh" lazy="false"/>
</class>
</hibernate-mapping> \ No newline at end of file
diff --git a/tests/org.eclipse.emf.teneo.hibernate.test/hbm/org.eclipse.emf.teneo.test.emf.relation/Relation1to1Action_mysql_e_o_hibernate.hbm.xml b/tests/org.eclipse.emf.teneo.hibernate.test/hbm/org.eclipse.emf.teneo.test.emf.relation/Relation1to1Action_mysql_e_o_hibernate.hbm.xml
index 890220cd3..8e5068aed 100644
--- a/tests/org.eclipse.emf.teneo.hibernate.test/hbm/org.eclipse.emf.teneo.test.emf.relation/Relation1to1Action_mysql_e_o_hibernate.hbm.xml
+++ b/tests/org.eclipse.emf.teneo.hibernate.test/hbm/org.eclipse.emf.teneo.test.emf.relation/Relation1to1Action_mysql_e_o_hibernate.hbm.xml
@@ -86,7 +86,7 @@
<property name="name" lazy="false" insert="true" update="true" not-null="true" unique="false" type="java.lang.String">
<column not-null="true" unique="false" name="`name`"/>
</property>
- <one-to-one name="main" entity-name="Main" cascade="merge,persist,save-update,lock,refresh" property-ref="notcontainedtwowaynotrequired" lazy="false"/>
+ <one-to-one name="main" entity-name="Main" cascade="merge,persist,save-update,lock,refresh" lazy="false"/>
</class>
<class name="org.eclipse.emf.teneo.samples.emf.relation.relation1to1.impl.NotContainedChildNRTNRImpl" entity-name="NotContainedChildNRTNR" abstract="false" lazy="false" table="`notcontainedchildnrtnr`">
<meta attribute="eclassName">NotContainedChildNRTNR</meta>
@@ -101,7 +101,7 @@
<property name="name" lazy="false" insert="true" update="true" not-null="true" unique="false" type="java.lang.String">
<column not-null="true" unique="false" name="`name`"/>
</property>
- <one-to-one name="main" entity-name="Main" cascade="merge,persist,save-update,lock,refresh" property-ref="notcontainedtwowaynotrequirednr" lazy="false"/>
+ <one-to-one name="main" entity-name="Main" cascade="merge,persist,save-update,lock,refresh" lazy="false"/>
</class>
<class name="org.eclipse.emf.teneo.samples.emf.relation.relation1to1.impl.NotContainedChildRImpl" entity-name="NotContainedChildR" abstract="false" lazy="false" table="`notcontainedchildr`">
<meta attribute="eclassName">NotContainedChildR</meta>
@@ -130,6 +130,6 @@
<property name="name" lazy="false" insert="true" update="true" not-null="true" unique="false" type="java.lang.String">
<column not-null="true" unique="false" name="`name`"/>
</property>
- <one-to-one name="main" entity-name="Main" cascade="merge,persist,save-update,lock,refresh" property-ref="notcontainedtwowayrequirednr" lazy="false"/>
+ <one-to-one name="main" entity-name="Main" cascade="merge,persist,save-update,lock,refresh" lazy="false"/>
</class>
</hibernate-mapping> \ No newline at end of file
diff --git a/tests/org.eclipse.emf.teneo.hibernate.test/hbm/org.eclipse.emf.teneo.test.emf.relation/Relation1to1Action_mysql_s_o_hibernate.hbm.xml b/tests/org.eclipse.emf.teneo.hibernate.test/hbm/org.eclipse.emf.teneo.test.emf.relation/Relation1to1Action_mysql_s_o_hibernate.hbm.xml
index 890220cd3..8e5068aed 100644
--- a/tests/org.eclipse.emf.teneo.hibernate.test/hbm/org.eclipse.emf.teneo.test.emf.relation/Relation1to1Action_mysql_s_o_hibernate.hbm.xml
+++ b/tests/org.eclipse.emf.teneo.hibernate.test/hbm/org.eclipse.emf.teneo.test.emf.relation/Relation1to1Action_mysql_s_o_hibernate.hbm.xml
@@ -86,7 +86,7 @@
<property name="name" lazy="false" insert="true" update="true" not-null="true" unique="false" type="java.lang.String">
<column not-null="true" unique="false" name="`name`"/>
</property>
- <one-to-one name="main" entity-name="Main" cascade="merge,persist,save-update,lock,refresh" property-ref="notcontainedtwowaynotrequired" lazy="false"/>
+ <one-to-one name="main" entity-name="Main" cascade="merge,persist,save-update,lock,refresh" lazy="false"/>
</class>
<class name="org.eclipse.emf.teneo.samples.emf.relation.relation1to1.impl.NotContainedChildNRTNRImpl" entity-name="NotContainedChildNRTNR" abstract="false" lazy="false" table="`notcontainedchildnrtnr`">
<meta attribute="eclassName">NotContainedChildNRTNR</meta>
@@ -101,7 +101,7 @@
<property name="name" lazy="false" insert="true" update="true" not-null="true" unique="false" type="java.lang.String">
<column not-null="true" unique="false" name="`name`"/>
</property>
- <one-to-one name="main" entity-name="Main" cascade="merge,persist,save-update,lock,refresh" property-ref="notcontainedtwowaynotrequirednr" lazy="false"/>
+ <one-to-one name="main" entity-name="Main" cascade="merge,persist,save-update,lock,refresh" lazy="false"/>
</class>
<class name="org.eclipse.emf.teneo.samples.emf.relation.relation1to1.impl.NotContainedChildRImpl" entity-name="NotContainedChildR" abstract="false" lazy="false" table="`notcontainedchildr`">
<meta attribute="eclassName">NotContainedChildR</meta>
@@ -130,6 +130,6 @@
<property name="name" lazy="false" insert="true" update="true" not-null="true" unique="false" type="java.lang.String">
<column not-null="true" unique="false" name="`name`"/>
</property>
- <one-to-one name="main" entity-name="Main" cascade="merge,persist,save-update,lock,refresh" property-ref="notcontainedtwowayrequirednr" lazy="false"/>
+ <one-to-one name="main" entity-name="Main" cascade="merge,persist,save-update,lock,refresh" lazy="false"/>
</class>
</hibernate-mapping> \ No newline at end of file
diff --git a/tests/org.eclipse.emf.teneo.hibernate.test/src/org/eclipse/emf/teneo/hibernate/test/issues/AllTests.java b/tests/org.eclipse.emf.teneo.hibernate.test/src/org/eclipse/emf/teneo/hibernate/test/issues/AllTests.java
index 4a68563a6..cfe8abb19 100644
--- a/tests/org.eclipse.emf.teneo.hibernate.test/src/org/eclipse/emf/teneo/hibernate/test/issues/AllTests.java
+++ b/tests/org.eclipse.emf.teneo.hibernate.test/src/org/eclipse/emf/teneo/hibernate/test/issues/AllTests.java
@@ -37,7 +37,7 @@ import org.eclipse.emf.teneo.test.issues.TopClassesAction;
* All tests
*
* @author <a href="mailto:mtaal@elver.org">Martin Taal</a>
- * @version $Revision: 1.23 $
+ * @version $Revision: 1.24 $
*/
public class AllTests {
@@ -45,6 +45,7 @@ public class AllTests {
TestSuite suite =
new MultiCfgTestSuite("Test for org.eclipse.emf.teneo.hibernate.test.issues", HibernateTestbed
.instance().getConfigurations());
+ suite.addTestSuite(Bz242995Action.class);
suite.addTestSuite(BZ237994Action.class);
suite.addTestSuite(BZ237790Action.class);
suite.addTestSuite(BZ237498Action.class);
diff --git a/tests/org.eclipse.emf.teneo.hibernate.test/src/org/eclipse/emf/teneo/hibernate/test/issues/Bz242995Action.java b/tests/org.eclipse.emf.teneo.hibernate.test/src/org/eclipse/emf/teneo/hibernate/test/issues/Bz242995Action.java
new file mode 100644
index 000000000..728012179
--- /dev/null
+++ b/tests/org.eclipse.emf.teneo.hibernate.test/src/org/eclipse/emf/teneo/hibernate/test/issues/Bz242995Action.java
@@ -0,0 +1,92 @@
+/**
+ * <copyright> Copyright (c) 2005, 2006, 2007, 2008 Springsite BV (The Netherlands) and others All rights
+ * reserved. This program and the accompanying materials are made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html Contributors: Martin Taal </copyright> $Id:
+ * AgilAction.java,v 1.1 2007/03/28 13:58:33 mtaal Exp $
+ */
+
+package org.eclipse.emf.teneo.hibernate.test.issues;
+
+import java.util.Properties;
+
+import org.eclipse.emf.ecore.EPackage;
+import org.eclipse.emf.teneo.PersistenceOptions;
+import org.eclipse.emf.teneo.samples.issues.bz242995.Author;
+import org.eclipse.emf.teneo.samples.issues.bz242995.Book;
+import org.eclipse.emf.teneo.samples.issues.bz242995.BookCategory;
+import org.eclipse.emf.teneo.samples.issues.bz242995.Library;
+import org.eclipse.emf.teneo.samples.issues.bz242995.OneTimeWonder;
+import org.eclipse.emf.teneo.samples.issues.bz242995.Writer;
+import org.eclipse.emf.teneo.samples.issues.bz242995.bz242995Factory;
+import org.eclipse.emf.teneo.samples.issues.bz242995.bz242995Package;
+import org.eclipse.emf.teneo.test.AbstractTestAction;
+import org.eclipse.emf.teneo.test.stores.TestStore;
+import org.hibernate.proxy.HibernateProxy;
+
+/**
+ * @author <a href="mailto:mtaal@elver.org">Martin Taal</a>
+ * @version $Revision: 1.1 $
+ */
+public class Bz242995Action extends AbstractTestAction {
+
+ public Bz242995Action() {
+ super(new EPackage[] { bz242995Package.eINSTANCE });
+ }
+
+ @Override
+ public Properties getExtraConfigurationProperties() {
+ final Properties props = new Properties();
+ props.setProperty(PersistenceOptions.SET_PROXY, "true");
+ return props;
+ }
+
+ @Override
+ public void doAction(TestStore store) {
+ {
+ store.beginTransaction();
+ // Create a library.
+ Library library = bz242995Factory.eINSTANCE.createLibrary();
+ library.setName("My Library");
+ // Make it persistent.
+ // session.save(library);
+
+ // Create a writer...
+ Writer writer = bz242995Factory.eINSTANCE.createWriter();
+ writer.setName("JRR Tolkien");
+ store.store(writer);//
+
+ // ...and one of his books.
+ Book book = bz242995Factory.eINSTANCE.createBook();
+ book.setAuthor(writer);
+ book.setPages(305);
+ book.setTitle("The Hobbit");
+ book.setCategory(BookCategory.SCIENCE_FICTION);
+ store.store(book);//
+ // Add the Writer and Book to the Library. They are made
+ // persistent automatically because the Library is already
+ // persistent.
+ library.getWriters().add(writer);
+ library.getBooks().add(book);
+ store.store(library);//
+
+ Author theAuthor = bz242995Factory.eINSTANCE.createAuthor();
+ theAuthor.setName("Arundati Roy");
+
+ OneTimeWonder wonder = bz242995Factory.eINSTANCE.createOneTimeWonder();
+ wonder.setName("God of small things");
+ wonder.setTheAuthor(theAuthor);
+ store.store(wonder);
+ store.store(theAuthor);
+ // Commit the changes to the database.
+ store.commitTransaction();
+ }
+ {
+ store.beginTransaction();
+ OneTimeWonder otw = store.getObject(OneTimeWonder.class);
+ Author auth = otw.getTheAuthor();
+ assertTrue(auth instanceof HibernateProxy);
+ store.commitTransaction();
+ }
+ }
+}

Back to the top