diff options
Diffstat (limited to 'tests')
4 files changed, 482 insertions, 0 deletions
diff --git a/tests/org.eclipse.emf.teneo.hibernate.test/hbm/org.eclipse.emf.teneo.hibernate.test.issues/Bz372869Action_hsqldb_e_o_hibernate.hbm.xml b/tests/org.eclipse.emf.teneo.hibernate.test/hbm/org.eclipse.emf.teneo.hibernate.test.issues/Bz372869Action_hsqldb_e_o_hibernate.hbm.xml new file mode 100644 index 000000000..5f9c80fed --- /dev/null +++ b/tests/org.eclipse.emf.teneo.hibernate.test/hbm/org.eclipse.emf.teneo.hibernate.test.issues/Bz372869Action_hsqldb_e_o_hibernate.hbm.xml @@ -0,0 +1,200 @@ +<?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"> + <typedef name="library.BookCategoryObject" class="org.eclipse.emf.teneo.hibernate.mapping.DefaultToStringUserType"> + <param name="epackage">http://www.eclipse.org/emf/teneo/samples/emf/sample/Library</param> + <param name="edatatype">BookCategoryObject</param> + </typedef> + <typedef name="rental.RentalBicycleTypeObject" class="org.eclipse.emf.teneo.hibernate.mapping.DefaultToStringUserType"> + <param name="epackage">http://www.eclipse.org/emf/teneo/rental</param> + <param name="edatatype">RentalBicycleTypeObject</param> + </typedef> + <typedef name="rental.RentalCarSizeObject" class="org.eclipse.emf.teneo.hibernate.mapping.DefaultToStringUserType"> + <param name="epackage">http://www.eclipse.org/emf/teneo/rental</param> + <param name="edatatype">RentalCarSizeObject</param> + </typedef> + <class name="org.eclipse.emf.teneo.samples.emf.sample.library.impl.BookImpl" entity-name="Book" abstract="false" lazy="false" table="`BOOK`"> + <meta attribute="eclassName" inherit="false">Book</meta> + <meta attribute="epackage" inherit="false">http://www.eclipse.org/emf/teneo/samples/emf/sample/Library</meta> + <id name="title" type="java.lang.String"> + <column not-null="true" unique="false" name="`TITLE`"/> + </id> + <version name="e_version" column="e_version" access="org.eclipse.emf.teneo.hibernate.mapping.property.VersionPropertyHandler"> + <meta attribute="syntheticVersion" inherit="false">true</meta> + </version> + <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.ENumUserIntegerType"> + <param name="enumClass">org.eclipse.emf.teneo.samples.emf.sample.library.BookCategory</param> + <param name="eclassifier">BookCategory</param> + <param name="epackage">http://www.eclipse.org/emf/teneo/samples/emf/sample/Library</param> + </type> + </property> + <many-to-one name="author" entity-name="Writer" lazy="false" cascade="merge,persist,save-update,lock,refresh" foreign-key="BOOK_AUTHOR" insert="false" update="false" not-null="false"> + <column not-null="false" unique="false" name="`BOOK_AUTHOR_E_ID`"/> + </many-to-one> + <property name="test" lazy="false" insert="true" update="true" not-null="false" unique="false" type="int"> + <column not-null="false" unique="false" name="`TEST`"/> + </property> + </class> + <class name="org.eclipse.emf.teneo.samples.emf.sample.library.impl.LibraryImpl" entity-name="Library" abstract="false" lazy="false" table="`LIBRARY`"> + <meta attribute="eclassName" inherit="false">Library</meta> + <meta attribute="epackage" inherit="false">http://www.eclipse.org/emf/teneo/samples/emf/sample/Library</meta> + <id type="long" name="e_id" column="e_id" access="org.eclipse.emf.teneo.hibernate.mapping.identifier.IdentifierPropertyHandler"> + <meta attribute="syntheticId" inherit="false">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" inherit="false">true</meta> + </version> + <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> + <list name="writers" fetch="subselect" lazy="true" cascade="all,delete-orphan"> + <key update="true" foreign-key="schrijvers"> + <column name="`LIBRARY_WRITERS_E_ID`" unique="false"/> + </key> + <list-index column="`TEST_INDEX`"/> + <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`" unique="false"/> + </key> + <list-index column="`LIBRARY_BOOKS_IDX`"/> + <one-to-many entity-name="Book"/> + </list> + </class> + <class name="org.eclipse.emf.teneo.samples.emf.sample.library.impl.WriterImpl" entity-name="Writer" abstract="false" lazy="false" table="`WRITER`"> + <meta attribute="eclassName" inherit="false">Writer</meta> + <meta attribute="epackage" inherit="false">http://www.eclipse.org/emf/teneo/samples/emf/sample/Library</meta> + <id type="long" name="e_id" column="e_id" access="org.eclipse.emf.teneo.hibernate.mapping.identifier.IdentifierPropertyHandler"> + <meta attribute="syntheticId" inherit="false">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" inherit="false">true</meta> + </version> + <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> + <list name="books" lazy="true" cascade="persist,merge,refresh,save-update,lock"> + <key update="true"> + <column name="`BOOK_AUTHOR_E_ID`" unique="false"/> + </key> + <list-index column="`WRITER_BOOKS_IDX`"/> + <one-to-many entity-name="Book"/> + </list> + </class> + <class name="org.eclipse.emf.teneo.rental.impl.RentalUnitImpl" entity-name="RentalUnit" abstract="true" lazy="false" table="`RENTALUNIT`"> + <meta attribute="eclassName" inherit="false">RentalUnit</meta> + <meta attribute="epackage" inherit="false">http://www.eclipse.org/emf/teneo/rental</meta> + <id name="description" type="java.lang.String"> + <column not-null="true" unique="false" name="`DESCRIPTION`"/> + </id> + <version name="e_version" column="e_version" access="org.eclipse.emf.teneo.hibernate.mapping.property.VersionPropertyHandler"> + <meta attribute="syntheticVersion" inherit="false">true</meta> + </version> + </class> + <joined-subclass name="org.eclipse.emf.teneo.rental.impl.RentalBicycleImpl" entity-name="RentalBicycle" abstract="false" lazy="false" extends="RentalUnit" table="`RENTALBICYCLE`"> + <meta attribute="eclassName" inherit="false">RentalBicycle</meta> + <meta attribute="epackage" inherit="false">http://www.eclipse.org/emf/teneo/rental</meta> + <key> + <column name="`RENTALUNIT_DESCRIPTION`"/> + </key> + <property name="type" lazy="false" not-null="false" insert="true" update="true" unique="false"> + <column not-null="false" unique="false" name="`TYPE`"/> + <type name="org.eclipse.emf.teneo.hibernate.mapping.ENumUserType"> + <param name="enumClass">org.eclipse.emf.teneo.rental.RentalBicycleType</param> + <param name="eclassifier">RentalBicycleType</param> + <param name="epackage">http://www.eclipse.org/emf/teneo/rental</param> + </type> + </property> + <many-to-one name="manufacturer" entity-name="Manufacturer" lazy="false" cascade="merge,persist,save-update,lock,refresh" foreign-key="RENTALBICYCLE_MANUFACTURER" insert="true" update="true" not-null="true"> + <column not-null="true" unique="false" name="`MANUFACTURER_MANUFACTURER_E_ID`"/> + </many-to-one> + </joined-subclass> + <class name="org.eclipse.emf.teneo.rental.impl.CurrencyImpl" entity-name="Currency" abstract="false" lazy="false" table="`CURRENCY`"> + <meta attribute="eclassName" inherit="false">Currency</meta> + <meta attribute="epackage" inherit="false">http://www.eclipse.org/emf/teneo/rental</meta> + <id type="long" name="e_id" column="e_id" access="org.eclipse.emf.teneo.hibernate.mapping.identifier.IdentifierPropertyHandler"> + <meta attribute="syntheticId" inherit="false">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" inherit="false">true</meta> + </version> + <property name="code" lazy="false" insert="true" update="true" not-null="true" unique="false" type="java.lang.String"> + <column not-null="true" unique="false" name="`CODE`"/> + </property> + </class> + <joined-subclass name="org.eclipse.emf.teneo.rental.impl.RentalCarImpl" entity-name="RentalCar" abstract="false" lazy="false" extends="RentalUnit" table="`RENTALCAR`"> + <meta attribute="eclassName" inherit="false">RentalCar</meta> + <meta attribute="epackage" inherit="false">http://www.eclipse.org/emf/teneo/rental</meta> + <key> + <column name="`RENTALUNIT_DESCRIPTION`"/> + </key> + <property name="size" lazy="false" not-null="false" insert="true" update="true" unique="false"> + <column not-null="false" unique="false" name="`SIZE`"/> + <type name="org.eclipse.emf.teneo.hibernate.mapping.ENumUserType"> + <param name="enumClass">org.eclipse.emf.teneo.rental.RentalCarSize</param> + <param name="eclassifier">RentalCarSize</param> + <param name="epackage">http://www.eclipse.org/emf/teneo/rental</param> + </type> + </property> + </joined-subclass> + <class name="org.eclipse.emf.teneo.rental.impl.RentalContractImpl" entity-name="RentalContract" abstract="false" lazy="false" table="`RENTALCONTRACT`"> + <meta attribute="eclassName" inherit="false">RentalContract</meta> + <meta attribute="epackage" inherit="false">http://www.eclipse.org/emf/teneo/rental</meta> + <id type="long" name="e_id" column="e_id" access="org.eclipse.emf.teneo.hibernate.mapping.identifier.IdentifierPropertyHandler"> + <meta attribute="syntheticId" inherit="false">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" inherit="false">true</meta> + </version> + <property name="rentToBusinessPartner" lazy="false" insert="true" update="true" not-null="true" unique="false" type="java.lang.String"> + <column not-null="true" unique="false" name="`RENTTOBUSINESSPARTNER`"/> + </property> + <property name="startDate" lazy="false" insert="true" update="true" not-null="true" unique="false" type="timestamp"> + <column not-null="true" unique="false" name="`STARTDATE`"/> + </property> + <property name="endDate" lazy="false" insert="true" update="true" not-null="false" unique="false" type="timestamp"> + <column not-null="false" unique="false" name="`ENDDATE`"/> + </property> + <property name="cost" lazy="false" insert="true" update="true" not-null="false" unique="false" type="float"> + <column not-null="false" unique="false" name="`COST`"/> + </property> + <list name="rentalUnits" lazy="true" cascade="persist,merge,refresh,save-update,lock"> + <key update="true" foreign-key="RENTALCONTRACT_RENTALUNITS"> + <column name="`RENTALCONTRACT_RENTALUNITS_E_ID`" unique="false"/> + </key> + <list-index column="`RENTALCONTRACT_RENTALUNITS_IDX`"/> + <one-to-many entity-name="RentalUnit"/> + </list> + <many-to-one name="currency" entity-name="Currency" lazy="false" cascade="merge,persist,save-update,lock,refresh" foreign-key="RENTALCONTRACT_CURRENCY" insert="true" update="true" not-null="false"> + <column not-null="false" unique="false" name="`CURRENCY_CURRENCY_E_ID`"/> + </many-to-one> + </class> + <class name="org.eclipse.emf.teneo.rental.impl.ManufacturerImpl" entity-name="Manufacturer" abstract="false" lazy="false" table="`MANUFACTURER`"> + <meta attribute="eclassName" inherit="false">Manufacturer</meta> + <meta attribute="epackage" inherit="false">http://www.eclipse.org/emf/teneo/rental</meta> + <id type="long" name="e_id" column="e_id" access="org.eclipse.emf.teneo.hibernate.mapping.identifier.IdentifierPropertyHandler"> + <meta attribute="syntheticId" inherit="false">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" inherit="false">true</meta> + </version> + <property name="code" lazy="false" insert="true" update="true" not-null="true" unique="false" type="java.lang.String"> + <column not-null="true" unique="false" name="`CODE`"/> + </property> + <property name="trusted" lazy="false" insert="true" update="true" not-null="false" unique="false" type="java.lang.Boolean"> + <column not-null="false" unique="false" name="`TRUSTED`"/> + </property> + </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/Bz372869Action_hsqldb_h_o_hibernate.hbm.xml b/tests/org.eclipse.emf.teneo.hibernate.test/hbm/org.eclipse.emf.teneo.hibernate.test.issues/Bz372869Action_hsqldb_h_o_hibernate.hbm.xml new file mode 100644 index 000000000..38a967c03 --- /dev/null +++ b/tests/org.eclipse.emf.teneo.hibernate.test/hbm/org.eclipse.emf.teneo.hibernate.test.issues/Bz372869Action_hsqldb_h_o_hibernate.hbm.xml @@ -0,0 +1,215 @@ +<?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"> + <typedef name="library.BookCategoryObject" class="org.eclipse.emf.teneo.hibernate.mapping.DefaultToStringUserType"> + <param name="epackage">http://www.eclipse.org/emf/teneo/samples/emf/sample/Library</param> + <param name="edatatype">BookCategoryObject</param> + </typedef> + <typedef name="rental.RentalBicycleTypeObject" class="org.eclipse.emf.teneo.hibernate.mapping.DefaultToStringUserType"> + <param name="epackage">http://www.eclipse.org/emf/teneo/rental</param> + <param name="edatatype">RentalBicycleTypeObject</param> + </typedef> + <typedef name="rental.RentalCarSizeObject" class="org.eclipse.emf.teneo.hibernate.mapping.DefaultToStringUserType"> + <param name="epackage">http://www.eclipse.org/emf/teneo/rental</param> + <param name="edatatype">RentalCarSizeObject</param> + </typedef> + <class name="org.eclipse.emf.teneo.samples.emf.sample.library.impl.BookImpl" entity-name="Book" abstract="false" lazy="false" discriminator-value="Book" table="`BOOK`"> + <meta attribute="eclassName" inherit="false">Book</meta> + <meta attribute="epackage" inherit="false">http://www.eclipse.org/emf/teneo/samples/emf/sample/Library</meta> + <id name="title" type="java.lang.String"> + <column not-null="true" unique="false" name="`TITLE`"/> + </id> + <discriminator type="string"> + <column name="`DTYPE`" index="BOOKDTYPE" length="255" not-null="true"/> + </discriminator> + <version name="e_version" column="e_version" access="org.eclipse.emf.teneo.hibernate.mapping.property.VersionPropertyHandler"> + <meta attribute="syntheticVersion" inherit="false">true</meta> + </version> + <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.ENumUserIntegerType"> + <param name="enumClass">org.eclipse.emf.teneo.samples.emf.sample.library.BookCategory</param> + <param name="eclassifier">BookCategory</param> + <param name="epackage">http://www.eclipse.org/emf/teneo/samples/emf/sample/Library</param> + </type> + </property> + <many-to-one name="author" entity-name="Writer" lazy="false" cascade="merge,persist,save-update,lock,refresh" foreign-key="BOOK_AUTHOR" insert="false" update="false" not-null="false"> + <column not-null="false" unique="false" name="`BOOK_AUTHOR_E_ID`"/> + </many-to-one> + <property name="test" lazy="false" insert="true" update="true" not-null="false" unique="false" type="int"> + <column not-null="false" unique="false" name="`TEST`"/> + </property> + </class> + <class name="org.eclipse.emf.teneo.samples.emf.sample.library.impl.LibraryImpl" entity-name="Library" abstract="false" lazy="false" discriminator-value="Library" table="`LIBRARY`"> + <meta attribute="eclassName" inherit="false">Library</meta> + <meta attribute="epackage" inherit="false">http://www.eclipse.org/emf/teneo/samples/emf/sample/Library</meta> + <id type="long" name="e_id" column="e_id" access="org.eclipse.emf.teneo.hibernate.mapping.identifier.IdentifierPropertyHandler"> + <meta attribute="syntheticId" inherit="false">true</meta> + <generator class="native"/> + </id> + <discriminator type="string"> + <column name="`DTYPE`" index="LIBRARYDTYPE" length="255" not-null="true"/> + </discriminator> + <version name="e_version" column="e_version" access="org.eclipse.emf.teneo.hibernate.mapping.property.VersionPropertyHandler"> + <meta attribute="syntheticVersion" inherit="false">true</meta> + </version> + <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> + <list name="writers" fetch="subselect" lazy="true" cascade="all,delete-orphan"> + <key update="true" foreign-key="schrijvers"> + <column name="`LIBRARY_WRITERS_E_ID`" unique="false"/> + </key> + <list-index column="`TEST_INDEX`"/> + <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`" unique="false"/> + </key> + <list-index column="`LIBRARY_BOOKS_IDX`"/> + <one-to-many entity-name="Book"/> + </list> + </class> + <class name="org.eclipse.emf.teneo.samples.emf.sample.library.impl.WriterImpl" entity-name="Writer" abstract="false" lazy="false" discriminator-value="Writer" table="`WRITER`"> + <meta attribute="eclassName" inherit="false">Writer</meta> + <meta attribute="epackage" inherit="false">http://www.eclipse.org/emf/teneo/samples/emf/sample/Library</meta> + <id type="long" name="e_id" column="e_id" access="org.eclipse.emf.teneo.hibernate.mapping.identifier.IdentifierPropertyHandler"> + <meta attribute="syntheticId" inherit="false">true</meta> + <generator class="native"/> + </id> + <discriminator type="string"> + <column name="`DTYPE`" index="WRITERDTYPE" length="255" not-null="true"/> + </discriminator> + <version name="e_version" column="e_version" access="org.eclipse.emf.teneo.hibernate.mapping.property.VersionPropertyHandler"> + <meta attribute="syntheticVersion" inherit="false">true</meta> + </version> + <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> + <list name="books" lazy="true" cascade="persist,merge,refresh,save-update,lock"> + <key update="true"> + <column name="`BOOK_AUTHOR_E_ID`" unique="false"/> + </key> + <list-index column="`WRITER_BOOKS_IDX`"/> + <one-to-many entity-name="Book"/> + </list> + </class> + <class name="org.eclipse.emf.teneo.rental.impl.RentalUnitImpl" entity-name="RentalUnit" abstract="true" lazy="false" discriminator-value="RentalUnit" table="`RENTALUNIT`"> + <meta attribute="eclassName" inherit="false">RentalUnit</meta> + <meta attribute="epackage" inherit="false">http://www.eclipse.org/emf/teneo/rental</meta> + <id name="description" type="java.lang.String"> + <column not-null="true" unique="false" name="`DESCRIPTION`"/> + </id> + <discriminator type="string"> + <column name="`DTYPE`" index="RENTALUNITDTYPE" length="255" not-null="true"/> + </discriminator> + <version name="e_version" column="e_version" access="org.eclipse.emf.teneo.hibernate.mapping.property.VersionPropertyHandler"> + <meta attribute="syntheticVersion" inherit="false">true</meta> + </version> + </class> + <subclass name="org.eclipse.emf.teneo.rental.impl.RentalBicycleImpl" entity-name="RentalBicycle" abstract="false" lazy="false" extends="RentalUnit" discriminator-value="RentalBicycle"> + <meta attribute="eclassName" inherit="false">RentalBicycle</meta> + <meta attribute="epackage" inherit="false">http://www.eclipse.org/emf/teneo/rental</meta> + <property name="type" lazy="false" not-null="false" insert="true" update="true" unique="false"> + <column not-null="false" unique="false" name="`TYPE`"/> + <type name="org.eclipse.emf.teneo.hibernate.mapping.ENumUserType"> + <param name="enumClass">org.eclipse.emf.teneo.rental.RentalBicycleType</param> + <param name="eclassifier">RentalBicycleType</param> + <param name="epackage">http://www.eclipse.org/emf/teneo/rental</param> + </type> + </property> + <many-to-one name="manufacturer" entity-name="Manufacturer" lazy="false" cascade="merge,persist,save-update,lock,refresh" foreign-key="RENTALBICYCLE_MANUFACTURER" insert="true" update="true" not-null="false"> + <column not-null="false" unique="false" name="`MANUFACTURER_MANUFACTURER_E_ID`"/> + </many-to-one> + </subclass> + <class name="org.eclipse.emf.teneo.rental.impl.CurrencyImpl" entity-name="Currency" abstract="false" lazy="false" discriminator-value="Currency" table="`CURRENCY`"> + <meta attribute="eclassName" inherit="false">Currency</meta> + <meta attribute="epackage" inherit="false">http://www.eclipse.org/emf/teneo/rental</meta> + <id type="long" name="e_id" column="e_id" access="org.eclipse.emf.teneo.hibernate.mapping.identifier.IdentifierPropertyHandler"> + <meta attribute="syntheticId" inherit="false">true</meta> + <generator class="native"/> + </id> + <discriminator type="string"> + <column name="`DTYPE`" index="CURRENCYDTYPE" length="255" not-null="true"/> + </discriminator> + <version name="e_version" column="e_version" access="org.eclipse.emf.teneo.hibernate.mapping.property.VersionPropertyHandler"> + <meta attribute="syntheticVersion" inherit="false">true</meta> + </version> + <property name="code" lazy="false" insert="true" update="true" not-null="true" unique="false" type="java.lang.String"> + <column not-null="true" unique="false" name="`CODE`"/> + </property> + </class> + <subclass name="org.eclipse.emf.teneo.rental.impl.RentalCarImpl" entity-name="RentalCar" abstract="false" lazy="false" extends="RentalUnit" discriminator-value="RentalCar"> + <meta attribute="eclassName" inherit="false">RentalCar</meta> + <meta attribute="epackage" inherit="false">http://www.eclipse.org/emf/teneo/rental</meta> + <property name="size" lazy="false" not-null="false" insert="true" update="true" unique="false"> + <column not-null="false" unique="false" name="`SIZE`"/> + <type name="org.eclipse.emf.teneo.hibernate.mapping.ENumUserType"> + <param name="enumClass">org.eclipse.emf.teneo.rental.RentalCarSize</param> + <param name="eclassifier">RentalCarSize</param> + <param name="epackage">http://www.eclipse.org/emf/teneo/rental</param> + </type> + </property> + </subclass> + <class name="org.eclipse.emf.teneo.rental.impl.RentalContractImpl" entity-name="RentalContract" abstract="false" lazy="false" discriminator-value="RentalContract" table="`RENTALCONTRACT`"> + <meta attribute="eclassName" inherit="false">RentalContract</meta> + <meta attribute="epackage" inherit="false">http://www.eclipse.org/emf/teneo/rental</meta> + <id type="long" name="e_id" column="e_id" access="org.eclipse.emf.teneo.hibernate.mapping.identifier.IdentifierPropertyHandler"> + <meta attribute="syntheticId" inherit="false">true</meta> + <generator class="native"/> + </id> + <discriminator type="string"> + <column name="`DTYPE`" index="RENTALCONTRACTDTYPE" length="255" not-null="true"/> + </discriminator> + <version name="e_version" column="e_version" access="org.eclipse.emf.teneo.hibernate.mapping.property.VersionPropertyHandler"> + <meta attribute="syntheticVersion" inherit="false">true</meta> + </version> + <property name="rentToBusinessPartner" lazy="false" insert="true" update="true" not-null="true" unique="false" type="java.lang.String"> + <column not-null="true" unique="false" name="`RENTTOBUSINESSPARTNER`"/> + </property> + <property name="startDate" lazy="false" insert="true" update="true" not-null="true" unique="false" type="timestamp"> + <column not-null="true" unique="false" name="`STARTDATE`"/> + </property> + <property name="endDate" lazy="false" insert="true" update="true" not-null="false" unique="false" type="timestamp"> + <column not-null="false" unique="false" name="`ENDDATE`"/> + </property> + <property name="cost" lazy="false" insert="true" update="true" not-null="false" unique="false" type="float"> + <column not-null="false" unique="false" name="`COST`"/> + </property> + <list name="rentalUnits" lazy="true" cascade="persist,merge,refresh,save-update,lock"> + <key update="true" foreign-key="RENTALCONTRACT_RENTALUNITS"> + <column name="`RENTALCONTRACT_RENTALUNITS_E_ID`" unique="false"/> + </key> + <list-index column="`RENTALCONTRACT_RENTALUNITS_IDX`"/> + <one-to-many entity-name="RentalUnit"/> + </list> + <many-to-one name="currency" entity-name="Currency" lazy="false" cascade="merge,persist,save-update,lock,refresh" foreign-key="RENTALCONTRACT_CURRENCY" insert="true" update="true" not-null="false"> + <column not-null="false" unique="false" name="`CURRENCY_CURRENCY_E_ID`"/> + </many-to-one> + </class> + <class name="org.eclipse.emf.teneo.rental.impl.ManufacturerImpl" entity-name="Manufacturer" abstract="false" lazy="false" discriminator-value="Manufacturer" table="`MANUFACTURER`"> + <meta attribute="eclassName" inherit="false">Manufacturer</meta> + <meta attribute="epackage" inherit="false">http://www.eclipse.org/emf/teneo/rental</meta> + <id type="long" name="e_id" column="e_id" access="org.eclipse.emf.teneo.hibernate.mapping.identifier.IdentifierPropertyHandler"> + <meta attribute="syntheticId" inherit="false">true</meta> + <generator class="native"/> + </id> + <discriminator type="string"> + <column name="`DTYPE`" index="MANUFACTURERDTYPE" length="255" not-null="true"/> + </discriminator> + <version name="e_version" column="e_version" access="org.eclipse.emf.teneo.hibernate.mapping.property.VersionPropertyHandler"> + <meta attribute="syntheticVersion" inherit="false">true</meta> + </version> + <property name="code" lazy="false" insert="true" update="true" not-null="true" unique="false" type="java.lang.String"> + <column not-null="true" unique="false" name="`CODE`"/> + </property> + <property name="trusted" lazy="false" insert="true" update="true" not-null="false" unique="false" type="java.lang.Boolean"> + <column not-null="false" unique="false" name="`TRUSTED`"/> + </property> + </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 b499cd59d..8dfde5556 100755 --- 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 @@ -56,6 +56,7 @@ public class AllTests { "Test for org.eclipse.emf.teneo.hibernate.test.issues", HibernateTestbed.instance().getConfigurations()); + suite.addTestSuite(Bz372869Action.class); suite.addTestSuite(Bz363777Action.class); suite.addTestSuite(Bz321765Action.class); suite.addTestSuite(Bz337580Action.class); diff --git a/tests/org.eclipse.emf.teneo.hibernate.test/src/org/eclipse/emf/teneo/hibernate/test/issues/Bz372869Action.java b/tests/org.eclipse.emf.teneo.hibernate.test/src/org/eclipse/emf/teneo/hibernate/test/issues/Bz372869Action.java new file mode 100644 index 000000000..c33542d57 --- /dev/null +++ b/tests/org.eclipse.emf.teneo.hibernate.test/src/org/eclipse/emf/teneo/hibernate/test/issues/Bz372869Action.java @@ -0,0 +1,66 @@ +/** + * <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 junit.framework.Assert; + +import org.eclipse.emf.ecore.EPackage; +import org.eclipse.emf.teneo.ERuntime; +import org.eclipse.emf.teneo.PersistenceOptions; +import org.eclipse.emf.teneo.ecore.EModelResolver; +import org.eclipse.emf.teneo.hibernate.HbDataStore; +import org.eclipse.emf.teneo.rental.RentalPackage; +import org.eclipse.emf.teneo.samples.emf.sample.library.LibraryPackage; +import org.eclipse.emf.teneo.samples.emf.sample.product.ProductPackage; +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 Bz372869Action extends AbstractTestAction { + + public Bz372869Action() { + super(new EPackage[] { LibraryPackage.eINSTANCE, RentalPackage.eINSTANCE }); + } + + @Override + public void doAction(TestStore store) { + EModelResolver.instance().register(new EPackage[]{ProductPackage.eINSTANCE}); + Assert.assertTrue(EModelResolver.instance().isRegistered(ProductPackage.eINSTANCE)); + Assert.assertTrue(EModelResolver.instance().isRegistered(LibraryPackage.eINSTANCE)); + Assert.assertTrue(EModelResolver.instance().isRegistered(RentalPackage.eINSTANCE)); + Assert.assertTrue(ERuntime.instance().isRegistered(RentalPackage.eINSTANCE)); + Assert.assertTrue(ERuntime.instance().isRegistered(RentalPackage.eINSTANCE)); + Assert.assertNotNull(ERuntime.instance().getJavaClass(LibraryPackage.eINSTANCE.getBook())); + Assert.assertNotNull(ERuntime.instance().getJavaClass(RentalPackage.eINSTANCE.getCurrency())); + Assert.assertNotNull(ERuntime.instance().getJavaClass(ProductPackage.eINSTANCE.getProductType())); + ((HbDataStore)store.getDataStore()).close(); + Assert.assertTrue(EModelResolver.instance().isRegistered(ProductPackage.eINSTANCE)); + Assert.assertFalse(EModelResolver.instance().isRegistered(LibraryPackage.eINSTANCE)); + Assert.assertFalse(EModelResolver.instance().isRegistered(RentalPackage.eINSTANCE)); + Assert.assertFalse(ERuntime.instance().isRegistered(RentalPackage.eINSTANCE)); + Assert.assertFalse(ERuntime.instance().isRegistered(RentalPackage.eINSTANCE)); + Assert.assertNull(ERuntime.instance().getJavaClass(LibraryPackage.eINSTANCE.getBook())); + Assert.assertNull(ERuntime.instance().getJavaClass(RentalPackage.eINSTANCE.getCurrency())); + Assert.assertNotNull(ERuntime.instance().getJavaClass(ProductPackage.eINSTANCE.getProductType())); + } +} |