diff options
author | Martin Taal | 2013-01-15 10:46:03 +0000 |
---|---|---|
committer | Martin Taal | 2013-01-15 10:46:03 +0000 |
commit | a6fb8402efe9ce72048b84ac28ba4e90981bf6f3 (patch) | |
tree | d79791893a25615601b0daab76193ded8a01c498 | |
parent | 0db643e6dbfdbfaf3bdfc2c010939b3fccb512cf (diff) | |
download | org.eclipse.emf.teneo-a6fb8402efe9ce72048b84ac28ba4e90981bf6f3.tar.gz org.eclipse.emf.teneo-a6fb8402efe9ce72048b84ac28ba4e90981bf6f3.tar.xz org.eclipse.emf.teneo-a6fb8402efe9ce72048b84ac28ba4e90981bf6f3.zip |
Related to issue 398156
5 files changed, 667 insertions, 2 deletions
diff --git a/tests/org.eclipse.emf.teneo.hibernate.test/hbm/org.eclipse.emf.teneo.hibernate.test.emf.auditing/Bz398156Action_hsqldb_e_o_hibernate.hbm.xml b/tests/org.eclipse.emf.teneo.hibernate.test/hbm/org.eclipse.emf.teneo.hibernate.test.emf.auditing/Bz398156Action_hsqldb_e_o_hibernate.hbm.xml new file mode 100644 index 000000000..4917d0c7a --- /dev/null +++ b/tests/org.eclipse.emf.teneo.hibernate.test/hbm/org.eclipse.emf.teneo.hibernate.test.emf.auditing/Bz398156Action_hsqldb_e_o_hibernate.hbm.xml @@ -0,0 +1,299 @@ +<?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> + <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 foreign-key="SCHRIJVERS_KEY" update="true"> + <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 foreign-key="LIBRARY_BOOKS_KEY" update="true"> + <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.hibernate.auditing.model.teneoauditing.impl.TeneoAuditCommitInfoImpl" entity-name="TeneoAuditCommitInfo" abstract="false" lazy="false" table="`TENEOAUDITCOMMITINFO`"> + <meta attribute="eclassName" inherit="false">TeneoAuditCommitInfo</meta> + <meta attribute="epackage" inherit="false">http://www.eclipse.org/emf/teneo/hibernate/auditing</meta> + <id name="id" type="long" unsaved-value="0"> + <column not-null="true" unique="false" name="`ID`"/> + <generator class="native"/> + </id> + <version name="version" type="long"> + <column not-null="true" unique="false" name="`VERSION`"/> + </version> + <property name="user" lazy="false" insert="true" update="true" not-null="false" unique="false" type="java.lang.String"> + <column not-null="false" unique="false" name="`USER`"/> + </property> + <property name="comment" lazy="false" insert="true" update="true" not-null="false" unique="false" type="java.lang.String"> + <column not-null="false" unique="false" name="`COMMENT`" length="2000"/> + </property> + <property name="commitTime" lazy="false" insert="true" update="true" not-null="false" unique="false" type="long"> + <column not-null="false" unique="false" name="`COMMITTIME`"/> + </property> + </class> + <class name="org.eclipse.emf.teneo.hibernate.auditing.model.teneoauditing.impl.TeneoAuditEntryImpl" entity-name="audit_Book" abstract="false" lazy="false" table="`AUDIT_BOOK`"> + <meta attribute="eclassName" inherit="false">audit_Book</meta> + <meta attribute="epackage" inherit="false">http://www.eclipse.org/emf/teneo/samples/emf/sample/LibraryAuditing</meta> + <id name="teneo_audit_id" type="long" unsaved-value="0"> + <column not-null="true" unique="false" name="`TENEO_AUDIT_ID`"/> + <generator class="native"/> + </id> + <version name="teneo_version" type="long"> + <column not-null="true" unique="false" name="`TENEO_VERSION`"/> + </version> + <property name="teneo_object_id" lazy="false" insert="true" update="true" not-null="false" unique="false" type="java.lang.String"> + <column not-null="false" unique="false" name="`TENEO_OBJECT_ID`" unique-key="c0,c1,c2"/> + </property> + <property name="teneo_owner_object_id" lazy="false" insert="true" update="true" not-null="false" unique="false" type="java.lang.String"> + <column not-null="false" unique="false" name="`TENEO_OWNER_OBJECT_ID`" index="teneo_derived_object"/> + </property> + <property name="teneo_start" lazy="false" insert="true" update="true" not-null="false" unique="false" type="long"> + <column not-null="false" unique="false" name="`TENEO_START`" unique-key="c0"/> + </property> + <property name="teneo_end" lazy="false" insert="true" update="true" not-null="false" unique="false" type="long"> + <column not-null="false" unique="false" name="`TENEO_END`" unique-key="c1"/> + </property> + <many-to-one name="teneo_commit_info" entity-name="TeneoAuditCommitInfo" lazy="false" cascade="merge,persist,save-update,lock,refresh" foreign-key="AUDIT_BOOK_TENEO_COMMIT_INFO" insert="true" update="true" not-null="true"> + <column not-null="true" unique="false" name="`TENEOAUDITCOMMITINFO_TENEO_COMMIT_INFO_ID`"/> + </many-to-one> + <property name="teneo_audit_kind" lazy="false" not-null="true" insert="true" update="true" unique="false"> + <column not-null="true" unique="false" name="`TENEO_AUDIT_KIND`"/> + <type name="org.eclipse.emf.teneo.hibernate.mapping.ENumUserType"> + <param name="enumClass">org.eclipse.emf.teneo.hibernate.auditing.model.teneoauditing.TeneoAuditKind</param> + <param name="eclassifier">TeneoAuditKind</param> + <param name="epackage">http://www.eclipse.org/emf/teneo/hibernate/auditing</param> + </type> + </property> + <property name="teneo_container_id" lazy="false" insert="true" update="true" not-null="false" unique="false" type="java.lang.String"> + <column not-null="false" unique="false" name="`TENEO_CONTAINER_ID`"/> + </property> + <property name="teneo_container_feature_id" lazy="false" insert="true" update="true" not-null="false" unique="false" type="int"> + <column not-null="false" unique="false" name="`TENEO_CONTAINER_FEATURE_ID`"/> + </property> + <property name="teneo_previous_start" lazy="false" insert="true" update="true" not-null="false" unique="false" type="long"> + <column not-null="false" unique="false" name="`TENEO_PREVIOUS_START`" unique-key="c2"/> + </property> + <property name="teneo_object_version" lazy="false" insert="true" update="true" not-null="false" unique="false" type="long"> + <column not-null="false" unique="false" name="`TENEO_OBJECT_VERSION`"/> + </property> + <property name="teneo_resourceid" lazy="false" insert="true" update="true" not-null="false" unique="false" type="java.lang.String"> + <column not-null="false" unique="false" name="`TENEO_RESOURCEID`"/> + </property> + <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.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> + <property name="author" lazy="false" insert="true" update="true" not-null="false" unique="false" type="java.lang.String"> + <column not-null="false" unique="false" name="`AUTHOR`"/> + </property> + <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.hibernate.auditing.model.teneoauditing.impl.TeneoAuditEntryImpl" entity-name="audit_Library" abstract="false" lazy="false" table="`AUDIT_LIBRARY`"> + <meta attribute="eclassName" inherit="false">audit_Library</meta> + <meta attribute="epackage" inherit="false">http://www.eclipse.org/emf/teneo/samples/emf/sample/LibraryAuditing</meta> + <id name="teneo_audit_id" type="long" unsaved-value="0"> + <column not-null="true" unique="false" name="`TENEO_AUDIT_ID`"/> + <generator class="native"/> + </id> + <version name="teneo_version" type="long"> + <column not-null="true" unique="false" name="`TENEO_VERSION`"/> + </version> + <property name="teneo_object_id" lazy="false" insert="true" update="true" not-null="false" unique="false" type="java.lang.String"> + <column not-null="false" unique="false" name="`TENEO_OBJECT_ID`" unique-key="c0,c1,c2"/> + </property> + <property name="teneo_owner_object_id" lazy="false" insert="true" update="true" not-null="false" unique="false" type="java.lang.String"> + <column not-null="false" unique="false" name="`TENEO_OWNER_OBJECT_ID`" index="teneo_derived_object"/> + </property> + <property name="teneo_start" lazy="false" insert="true" update="true" not-null="false" unique="false" type="long"> + <column not-null="false" unique="false" name="`TENEO_START`" unique-key="c0"/> + </property> + <property name="teneo_end" lazy="false" insert="true" update="true" not-null="false" unique="false" type="long"> + <column not-null="false" unique="false" name="`TENEO_END`" unique-key="c1"/> + </property> + <many-to-one name="teneo_commit_info" entity-name="TeneoAuditCommitInfo" lazy="false" cascade="merge,persist,save-update,lock,refresh" foreign-key="AUDIT_LIBRARY_TENEO_COMMIT_INFO" insert="true" update="true" not-null="true"> + <column not-null="true" unique="false" name="`TENEOAUDITCOMMITINFO_TENEO_COMMIT_INFO_ID`"/> + </many-to-one> + <property name="teneo_audit_kind" lazy="false" not-null="true" insert="true" update="true" unique="false"> + <column not-null="true" unique="false" name="`TENEO_AUDIT_KIND`"/> + <type name="org.eclipse.emf.teneo.hibernate.mapping.ENumUserType"> + <param name="enumClass">org.eclipse.emf.teneo.hibernate.auditing.model.teneoauditing.TeneoAuditKind</param> + <param name="eclassifier">TeneoAuditKind</param> + <param name="epackage">http://www.eclipse.org/emf/teneo/hibernate/auditing</param> + </type> + </property> + <property name="teneo_container_id" lazy="false" insert="true" update="true" not-null="false" unique="false" type="java.lang.String"> + <column not-null="false" unique="false" name="`TENEO_CONTAINER_ID`"/> + </property> + <property name="teneo_container_feature_id" lazy="false" insert="true" update="true" not-null="false" unique="false" type="int"> + <column not-null="false" unique="false" name="`TENEO_CONTAINER_FEATURE_ID`"/> + </property> + <property name="teneo_previous_start" lazy="false" insert="true" update="true" not-null="false" unique="false" type="long"> + <column not-null="false" unique="false" name="`TENEO_PREVIOUS_START`" unique-key="c2"/> + </property> + <property name="teneo_object_version" lazy="false" insert="true" update="true" not-null="false" unique="false" type="long"> + <column not-null="false" unique="false" name="`TENEO_OBJECT_VERSION`"/> + </property> + <property name="teneo_resourceid" lazy="false" insert="true" update="true" not-null="false" unique="false" type="java.lang.String"> + <column not-null="false" unique="false" name="`TENEO_RESOURCEID`"/> + </property> + <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" table="`AUDIT_LIBRARY_WRITERSAUDITING`" lazy="true" cascade="all"> + <key foreign-key="AUDIT_LIBRARY_WRITERS_KEY" update="true"> + <column name="`AUDIT_LIBRARY_WRITERS_TENEO_AUDIT_ID`" unique="false"/> + </key> + <list-index column="`AUDIT_LIBRARY_WRITERS_IDX`"/> + <element type="java.lang.String"/> + </list> + <list name="books" table="`AUDIT_LIBRARY_BOOKSAUDITING`" lazy="true" cascade="all"> + <key foreign-key="AUDIT_LIBRARY_BOOKS_KEY" update="true"> + <column name="`AUDIT_LIBRARY_BOOKS_TENEO_AUDIT_ID`" unique="false"/> + </key> + <list-index column="`AUDIT_LIBRARY_BOOKS_IDX`"/> + <element type="java.lang.String"/> + </list> + </class> + <class name="org.eclipse.emf.teneo.hibernate.auditing.model.teneoauditing.impl.TeneoAuditEntryImpl" entity-name="audit_Writer" abstract="false" lazy="false" table="`AUDIT_WRITER`"> + <meta attribute="eclassName" inherit="false">audit_Writer</meta> + <meta attribute="epackage" inherit="false">http://www.eclipse.org/emf/teneo/samples/emf/sample/LibraryAuditing</meta> + <id name="teneo_audit_id" type="long" unsaved-value="0"> + <column not-null="true" unique="false" name="`TENEO_AUDIT_ID`"/> + <generator class="native"/> + </id> + <version name="teneo_version" type="long"> + <column not-null="true" unique="false" name="`TENEO_VERSION`"/> + </version> + <property name="teneo_object_id" lazy="false" insert="true" update="true" not-null="false" unique="false" type="java.lang.String"> + <column not-null="false" unique="false" name="`TENEO_OBJECT_ID`" unique-key="c0,c1,c2"/> + </property> + <property name="teneo_owner_object_id" lazy="false" insert="true" update="true" not-null="false" unique="false" type="java.lang.String"> + <column not-null="false" unique="false" name="`TENEO_OWNER_OBJECT_ID`" index="teneo_derived_object"/> + </property> + <property name="teneo_start" lazy="false" insert="true" update="true" not-null="false" unique="false" type="long"> + <column not-null="false" unique="false" name="`TENEO_START`" unique-key="c0"/> + </property> + <property name="teneo_end" lazy="false" insert="true" update="true" not-null="false" unique="false" type="long"> + <column not-null="false" unique="false" name="`TENEO_END`" unique-key="c1"/> + </property> + <many-to-one name="teneo_commit_info" entity-name="TeneoAuditCommitInfo" lazy="false" cascade="merge,persist,save-update,lock,refresh" foreign-key="AUDIT_WRITER_TENEO_COMMIT_INFO" insert="true" update="true" not-null="true"> + <column not-null="true" unique="false" name="`TENEOAUDITCOMMITINFO_TENEO_COMMIT_INFO_ID`"/> + </many-to-one> + <property name="teneo_audit_kind" lazy="false" not-null="true" insert="true" update="true" unique="false"> + <column not-null="true" unique="false" name="`TENEO_AUDIT_KIND`"/> + <type name="org.eclipse.emf.teneo.hibernate.mapping.ENumUserType"> + <param name="enumClass">org.eclipse.emf.teneo.hibernate.auditing.model.teneoauditing.TeneoAuditKind</param> + <param name="eclassifier">TeneoAuditKind</param> + <param name="epackage">http://www.eclipse.org/emf/teneo/hibernate/auditing</param> + </type> + </property> + <property name="teneo_container_id" lazy="false" insert="true" update="true" not-null="false" unique="false" type="java.lang.String"> + <column not-null="false" unique="false" name="`TENEO_CONTAINER_ID`"/> + </property> + <property name="teneo_container_feature_id" lazy="false" insert="true" update="true" not-null="false" unique="false" type="int"> + <column not-null="false" unique="false" name="`TENEO_CONTAINER_FEATURE_ID`"/> + </property> + <property name="teneo_previous_start" lazy="false" insert="true" update="true" not-null="false" unique="false" type="long"> + <column not-null="false" unique="false" name="`TENEO_PREVIOUS_START`" unique-key="c2"/> + </property> + <property name="teneo_object_version" lazy="false" insert="true" update="true" not-null="false" unique="false" type="long"> + <column not-null="false" unique="false" name="`TENEO_OBJECT_VERSION`"/> + </property> + <property name="teneo_resourceid" lazy="false" insert="true" update="true" not-null="false" unique="false" type="java.lang.String"> + <column not-null="false" unique="false" name="`TENEO_RESOURCEID`"/> + </property> + <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" table="`AUDIT_WRITER_BOOKSAUDITING`" lazy="true" cascade="all"> + <key foreign-key="AUDIT_WRITER_BOOKS_KEY" update="true"> + <column name="`AUDIT_WRITER_BOOKS_TENEO_AUDIT_ID`" unique="false"/> + </key> + <list-index column="`AUDIT_WRITER_BOOKS_IDX`"/> + <element type="java.lang.String"/> + </list> + </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.emf.auditing/Bz398156Action_hsqldb_h_o_hibernate.hbm.xml b/tests/org.eclipse.emf.teneo.hibernate.test/hbm/org.eclipse.emf.teneo.hibernate.test.emf.auditing/Bz398156Action_hsqldb_h_o_hibernate.hbm.xml new file mode 100644 index 000000000..92cb6ab33 --- /dev/null +++ b/tests/org.eclipse.emf.teneo.hibernate.test/hbm/org.eclipse.emf.teneo.hibernate.test.emf.auditing/Bz398156Action_hsqldb_h_o_hibernate.hbm.xml @@ -0,0 +1,320 @@ +<?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> + <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 foreign-key="SCHRIJVERS_KEY" update="true"> + <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 foreign-key="LIBRARY_BOOKS_KEY" update="true"> + <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.hibernate.auditing.model.teneoauditing.impl.TeneoAuditCommitInfoImpl" entity-name="TeneoAuditCommitInfo" abstract="false" lazy="false" discriminator-value="TeneoAuditCommitInfo" table="`TENEOAUDITCOMMITINFO`"> + <meta attribute="eclassName" inherit="false">TeneoAuditCommitInfo</meta> + <meta attribute="epackage" inherit="false">http://www.eclipse.org/emf/teneo/hibernate/auditing</meta> + <id name="id" type="long" unsaved-value="0"> + <column not-null="true" unique="false" name="`ID`"/> + <generator class="native"/> + </id> + <discriminator type="string"> + <column name="`DTYPE`" index="TENEOAUDITCOMMITINFODTYPE" length="255" not-null="true"/> + </discriminator> + <version name="version" type="long"> + <column not-null="true" unique="false" name="`VERSION`"/> + </version> + <property name="user" lazy="false" insert="true" update="true" not-null="false" unique="false" type="java.lang.String"> + <column not-null="false" unique="false" name="`USER`"/> + </property> + <property name="comment" lazy="false" insert="true" update="true" not-null="false" unique="false" type="java.lang.String"> + <column not-null="false" unique="false" name="`COMMENT`" length="2000"/> + </property> + <property name="commitTime" lazy="false" insert="true" update="true" not-null="false" unique="false" type="long"> + <column not-null="false" unique="false" name="`COMMITTIME`"/> + </property> + </class> + <class name="org.eclipse.emf.teneo.hibernate.auditing.model.teneoauditing.impl.TeneoAuditEntryImpl" entity-name="audit_Book" abstract="false" lazy="false" discriminator-value="audit_Book" table="`AUDIT_BOOK`"> + <meta attribute="eclassName" inherit="false">audit_Book</meta> + <meta attribute="epackage" inherit="false">http://www.eclipse.org/emf/teneo/samples/emf/sample/LibraryAuditing</meta> + <id name="teneo_audit_id" type="long" unsaved-value="0"> + <column not-null="true" unique="false" name="`TENEO_AUDIT_ID`"/> + <generator class="native"/> + </id> + <discriminator type="string"> + <column name="`DTYPE`" index="AUDIT_BOOKDTYPE" length="255" not-null="true"/> + </discriminator> + <version name="teneo_version" type="long"> + <column not-null="true" unique="false" name="`TENEO_VERSION`"/> + </version> + <property name="teneo_object_id" lazy="false" insert="true" update="true" not-null="false" unique="false" type="java.lang.String"> + <column not-null="false" unique="false" name="`TENEO_OBJECT_ID`" unique-key="c0,c1,c2"/> + </property> + <property name="teneo_owner_object_id" lazy="false" insert="true" update="true" not-null="false" unique="false" type="java.lang.String"> + <column not-null="false" unique="false" name="`TENEO_OWNER_OBJECT_ID`" index="teneo_derived_object"/> + </property> + <property name="teneo_start" lazy="false" insert="true" update="true" not-null="false" unique="false" type="long"> + <column not-null="false" unique="false" name="`TENEO_START`" unique-key="c0"/> + </property> + <property name="teneo_end" lazy="false" insert="true" update="true" not-null="false" unique="false" type="long"> + <column not-null="false" unique="false" name="`TENEO_END`" unique-key="c1"/> + </property> + <many-to-one name="teneo_commit_info" entity-name="TeneoAuditCommitInfo" lazy="false" cascade="merge,persist,save-update,lock,refresh" foreign-key="AUDIT_BOOK_TENEO_COMMIT_INFO" insert="true" update="true" not-null="true"> + <column not-null="true" unique="false" name="`TENEOAUDITCOMMITINFO_TENEO_COMMIT_INFO_ID`"/> + </many-to-one> + <property name="teneo_audit_kind" lazy="false" not-null="true" insert="true" update="true" unique="false"> + <column not-null="true" unique="false" name="`TENEO_AUDIT_KIND`"/> + <type name="org.eclipse.emf.teneo.hibernate.mapping.ENumUserType"> + <param name="enumClass">org.eclipse.emf.teneo.hibernate.auditing.model.teneoauditing.TeneoAuditKind</param> + <param name="eclassifier">TeneoAuditKind</param> + <param name="epackage">http://www.eclipse.org/emf/teneo/hibernate/auditing</param> + </type> + </property> + <property name="teneo_container_id" lazy="false" insert="true" update="true" not-null="false" unique="false" type="java.lang.String"> + <column not-null="false" unique="false" name="`TENEO_CONTAINER_ID`"/> + </property> + <property name="teneo_container_feature_id" lazy="false" insert="true" update="true" not-null="false" unique="false" type="int"> + <column not-null="false" unique="false" name="`TENEO_CONTAINER_FEATURE_ID`"/> + </property> + <property name="teneo_previous_start" lazy="false" insert="true" update="true" not-null="false" unique="false" type="long"> + <column not-null="false" unique="false" name="`TENEO_PREVIOUS_START`" unique-key="c2"/> + </property> + <property name="teneo_object_version" lazy="false" insert="true" update="true" not-null="false" unique="false" type="long"> + <column not-null="false" unique="false" name="`TENEO_OBJECT_VERSION`"/> + </property> + <property name="teneo_resourceid" lazy="false" insert="true" update="true" not-null="false" unique="false" type="java.lang.String"> + <column not-null="false" unique="false" name="`TENEO_RESOURCEID`"/> + </property> + <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.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> + <property name="author" lazy="false" insert="true" update="true" not-null="false" unique="false" type="java.lang.String"> + <column not-null="false" unique="false" name="`AUTHOR`"/> + </property> + <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.hibernate.auditing.model.teneoauditing.impl.TeneoAuditEntryImpl" entity-name="audit_Library" abstract="false" lazy="false" discriminator-value="audit_Library" table="`AUDIT_LIBRARY`"> + <meta attribute="eclassName" inherit="false">audit_Library</meta> + <meta attribute="epackage" inherit="false">http://www.eclipse.org/emf/teneo/samples/emf/sample/LibraryAuditing</meta> + <id name="teneo_audit_id" type="long" unsaved-value="0"> + <column not-null="true" unique="false" name="`TENEO_AUDIT_ID`"/> + <generator class="native"/> + </id> + <discriminator type="string"> + <column name="`DTYPE`" index="AUDIT_LIBRARYDTYPE" length="255" not-null="true"/> + </discriminator> + <version name="teneo_version" type="long"> + <column not-null="true" unique="false" name="`TENEO_VERSION`"/> + </version> + <property name="teneo_object_id" lazy="false" insert="true" update="true" not-null="false" unique="false" type="java.lang.String"> + <column not-null="false" unique="false" name="`TENEO_OBJECT_ID`" unique-key="c0,c1,c2"/> + </property> + <property name="teneo_owner_object_id" lazy="false" insert="true" update="true" not-null="false" unique="false" type="java.lang.String"> + <column not-null="false" unique="false" name="`TENEO_OWNER_OBJECT_ID`" index="teneo_derived_object"/> + </property> + <property name="teneo_start" lazy="false" insert="true" update="true" not-null="false" unique="false" type="long"> + <column not-null="false" unique="false" name="`TENEO_START`" unique-key="c0"/> + </property> + <property name="teneo_end" lazy="false" insert="true" update="true" not-null="false" unique="false" type="long"> + <column not-null="false" unique="false" name="`TENEO_END`" unique-key="c1"/> + </property> + <many-to-one name="teneo_commit_info" entity-name="TeneoAuditCommitInfo" lazy="false" cascade="merge,persist,save-update,lock,refresh" foreign-key="AUDIT_LIBRARY_TENEO_COMMIT_INFO" insert="true" update="true" not-null="true"> + <column not-null="true" unique="false" name="`TENEOAUDITCOMMITINFO_TENEO_COMMIT_INFO_ID`"/> + </many-to-one> + <property name="teneo_audit_kind" lazy="false" not-null="true" insert="true" update="true" unique="false"> + <column not-null="true" unique="false" name="`TENEO_AUDIT_KIND`"/> + <type name="org.eclipse.emf.teneo.hibernate.mapping.ENumUserType"> + <param name="enumClass">org.eclipse.emf.teneo.hibernate.auditing.model.teneoauditing.TeneoAuditKind</param> + <param name="eclassifier">TeneoAuditKind</param> + <param name="epackage">http://www.eclipse.org/emf/teneo/hibernate/auditing</param> + </type> + </property> + <property name="teneo_container_id" lazy="false" insert="true" update="true" not-null="false" unique="false" type="java.lang.String"> + <column not-null="false" unique="false" name="`TENEO_CONTAINER_ID`"/> + </property> + <property name="teneo_container_feature_id" lazy="false" insert="true" update="true" not-null="false" unique="false" type="int"> + <column not-null="false" unique="false" name="`TENEO_CONTAINER_FEATURE_ID`"/> + </property> + <property name="teneo_previous_start" lazy="false" insert="true" update="true" not-null="false" unique="false" type="long"> + <column not-null="false" unique="false" name="`TENEO_PREVIOUS_START`" unique-key="c2"/> + </property> + <property name="teneo_object_version" lazy="false" insert="true" update="true" not-null="false" unique="false" type="long"> + <column not-null="false" unique="false" name="`TENEO_OBJECT_VERSION`"/> + </property> + <property name="teneo_resourceid" lazy="false" insert="true" update="true" not-null="false" unique="false" type="java.lang.String"> + <column not-null="false" unique="false" name="`TENEO_RESOURCEID`"/> + </property> + <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" table="`AUDIT_LIBRARY_WRITERSAUDITING`" lazy="true" cascade="all"> + <key foreign-key="AUDIT_LIBRARY_WRITERS_KEY" update="true"> + <column name="`AUDIT_LIBRARY_WRITERS_TENEO_AUDIT_ID`" unique="false"/> + </key> + <list-index column="`AUDIT_LIBRARY_WRITERS_IDX`"/> + <element type="java.lang.String"/> + </list> + <list name="books" table="`AUDIT_LIBRARY_BOOKSAUDITING`" lazy="true" cascade="all"> + <key foreign-key="AUDIT_LIBRARY_BOOKS_KEY" update="true"> + <column name="`AUDIT_LIBRARY_BOOKS_TENEO_AUDIT_ID`" unique="false"/> + </key> + <list-index column="`AUDIT_LIBRARY_BOOKS_IDX`"/> + <element type="java.lang.String"/> + </list> + </class> + <class name="org.eclipse.emf.teneo.hibernate.auditing.model.teneoauditing.impl.TeneoAuditEntryImpl" entity-name="audit_Writer" abstract="false" lazy="false" discriminator-value="audit_Writer" table="`AUDIT_WRITER`"> + <meta attribute="eclassName" inherit="false">audit_Writer</meta> + <meta attribute="epackage" inherit="false">http://www.eclipse.org/emf/teneo/samples/emf/sample/LibraryAuditing</meta> + <id name="teneo_audit_id" type="long" unsaved-value="0"> + <column not-null="true" unique="false" name="`TENEO_AUDIT_ID`"/> + <generator class="native"/> + </id> + <discriminator type="string"> + <column name="`DTYPE`" index="AUDIT_WRITERDTYPE" length="255" not-null="true"/> + </discriminator> + <version name="teneo_version" type="long"> + <column not-null="true" unique="false" name="`TENEO_VERSION`"/> + </version> + <property name="teneo_object_id" lazy="false" insert="true" update="true" not-null="false" unique="false" type="java.lang.String"> + <column not-null="false" unique="false" name="`TENEO_OBJECT_ID`" unique-key="c0,c1,c2"/> + </property> + <property name="teneo_owner_object_id" lazy="false" insert="true" update="true" not-null="false" unique="false" type="java.lang.String"> + <column not-null="false" unique="false" name="`TENEO_OWNER_OBJECT_ID`" index="teneo_derived_object"/> + </property> + <property name="teneo_start" lazy="false" insert="true" update="true" not-null="false" unique="false" type="long"> + <column not-null="false" unique="false" name="`TENEO_START`" unique-key="c0"/> + </property> + <property name="teneo_end" lazy="false" insert="true" update="true" not-null="false" unique="false" type="long"> + <column not-null="false" unique="false" name="`TENEO_END`" unique-key="c1"/> + </property> + <many-to-one name="teneo_commit_info" entity-name="TeneoAuditCommitInfo" lazy="false" cascade="merge,persist,save-update,lock,refresh" foreign-key="AUDIT_WRITER_TENEO_COMMIT_INFO" insert="true" update="true" not-null="true"> + <column not-null="true" unique="false" name="`TENEOAUDITCOMMITINFO_TENEO_COMMIT_INFO_ID`"/> + </many-to-one> + <property name="teneo_audit_kind" lazy="false" not-null="true" insert="true" update="true" unique="false"> + <column not-null="true" unique="false" name="`TENEO_AUDIT_KIND`"/> + <type name="org.eclipse.emf.teneo.hibernate.mapping.ENumUserType"> + <param name="enumClass">org.eclipse.emf.teneo.hibernate.auditing.model.teneoauditing.TeneoAuditKind</param> + <param name="eclassifier">TeneoAuditKind</param> + <param name="epackage">http://www.eclipse.org/emf/teneo/hibernate/auditing</param> + </type> + </property> + <property name="teneo_container_id" lazy="false" insert="true" update="true" not-null="false" unique="false" type="java.lang.String"> + <column not-null="false" unique="false" name="`TENEO_CONTAINER_ID`"/> + </property> + <property name="teneo_container_feature_id" lazy="false" insert="true" update="true" not-null="false" unique="false" type="int"> + <column not-null="false" unique="false" name="`TENEO_CONTAINER_FEATURE_ID`"/> + </property> + <property name="teneo_previous_start" lazy="false" insert="true" update="true" not-null="false" unique="false" type="long"> + <column not-null="false" unique="false" name="`TENEO_PREVIOUS_START`" unique-key="c2"/> + </property> + <property name="teneo_object_version" lazy="false" insert="true" update="true" not-null="false" unique="false" type="long"> + <column not-null="false" unique="false" name="`TENEO_OBJECT_VERSION`"/> + </property> + <property name="teneo_resourceid" lazy="false" insert="true" update="true" not-null="false" unique="false" type="java.lang.String"> + <column not-null="false" unique="false" name="`TENEO_RESOURCEID`"/> + </property> + <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" table="`AUDIT_WRITER_BOOKSAUDITING`" lazy="true" cascade="all"> + <key foreign-key="AUDIT_WRITER_BOOKS_KEY" update="true"> + <column name="`AUDIT_WRITER_BOOKS_TENEO_AUDIT_ID`" unique="false"/> + </key> + <list-index column="`AUDIT_WRITER_BOOKS_IDX`"/> + <element type="java.lang.String"/> + </list> + </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/emf/auditing/AllTests.java b/tests/org.eclipse.emf.teneo.hibernate.test/src/org/eclipse/emf/teneo/hibernate/test/emf/auditing/AllTests.java index b9f9b95df..9cc571629 100755 --- a/tests/org.eclipse.emf.teneo.hibernate.test/src/org/eclipse/emf/teneo/hibernate/test/emf/auditing/AllTests.java +++ b/tests/org.eclipse.emf.teneo.hibernate.test/src/org/eclipse/emf/teneo/hibernate/test/emf/auditing/AllTests.java @@ -34,6 +34,7 @@ public class AllTests { TestSuite suite = new MultiCfgTestSuite( "Test for org.eclipse.emf.teneo.hibernate.test.emf.auditing", HibernateTestbed.instance() .getConfigurations()); + suite.addTestSuite(Bz398156Action.class); suite.addTestSuite(EMapAuditingNoTrueEMapAction.class); suite.addTestSuite(EMapAuditingTrueEMapAction.class); suite.addTestSuite(SimpleArrayAuditingAction.class); diff --git a/tests/org.eclipse.emf.teneo.hibernate.test/src/org/eclipse/emf/teneo/hibernate/test/emf/auditing/Bz398156Action.java b/tests/org.eclipse.emf.teneo.hibernate.test/src/org/eclipse/emf/teneo/hibernate/test/emf/auditing/Bz398156Action.java new file mode 100644 index 000000000..dc186277c --- /dev/null +++ b/tests/org.eclipse.emf.teneo.hibernate.test/src/org/eclipse/emf/teneo/hibernate/test/emf/auditing/Bz398156Action.java @@ -0,0 +1,39 @@ +/** + * <copyright> Copyright (c) 2013 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: + * DynamicAction.java,v 1.4 2007/03/20 23:33:38 mtaal Exp $ + */ + +package org.eclipse.emf.teneo.hibernate.test.emf.auditing; + +import java.util.Properties; + +import org.eclipse.emf.teneo.PersistenceOptions; + +/** + * @author <a href="mailto:mtaal@elver.org">Martin Taal</a> + * @version $Revision: 1.17 $ + */ +public class Bz398156Action extends SimpleLibraryAuditingAction { + + /* + * (non-Javadoc) + * + * @see org.eclipse.emf.teneo.test.AbstractTestAction#getExtraConfigurationProperties () + */ + @Override + public Properties getExtraConfigurationProperties() { + final Properties props = super.getExtraConfigurationProperties(); + // props.put(PersistenceOptions.AUDITING_DB_SCHEMA, "dbschema"); + props.put(PersistenceOptions.AUDITING_ENTITY_POSTFIX, ""); + props.put(PersistenceOptions.AUDITING_ENTITY_PREFIX, "audit_"); + return props; + } + + protected String getAuditEntityName(String eClassName) { + return "audit_" + eClassName; + } + +}
\ No newline at end of file diff --git a/tests/org.eclipse.emf.teneo.hibernate.test/src/org/eclipse/emf/teneo/hibernate/test/emf/auditing/SimpleLibraryAuditingAction.java b/tests/org.eclipse.emf.teneo.hibernate.test/src/org/eclipse/emf/teneo/hibernate/test/emf/auditing/SimpleLibraryAuditingAction.java index 40348d0ea..d6b04f50b 100644 --- a/tests/org.eclipse.emf.teneo.hibernate.test/src/org/eclipse/emf/teneo/hibernate/test/emf/auditing/SimpleLibraryAuditingAction.java +++ b/tests/org.eclipse.emf.teneo.hibernate.test/src/org/eclipse/emf/teneo/hibernate/test/emf/auditing/SimpleLibraryAuditingAction.java @@ -61,6 +61,8 @@ public class SimpleLibraryAuditingAction extends AbstractTestAction { /** Creates an item, an address and links them to a po. */ @Override public void doAction(TestStore store) { + System.err.println(store.getMappingXML()); + testSimpleChange(store); testContainer(store); testQuery(store); @@ -266,7 +268,7 @@ public class SimpleLibraryAuditingAction extends AbstractTestAction { store.beginTransaction(); final AuditVersionProvider vp = testStore.getEmfDataStore().getAuditVersionProvider(); final Query qry = testStore.getSession().createQuery( - "select e from BookAuditing e where author=:author"); + "select e from " + getAuditEntityName("Book") + " e where author=:author"); final String idString = vp.getIdString(w); qry.setParameter("author", idString); final List<?> list = qry.list(); @@ -281,7 +283,7 @@ public class SimpleLibraryAuditingAction extends AbstractTestAction { store.beginTransaction(); final AuditVersionProvider vp = testStore.getEmfDataStore().getAuditVersionProvider(); final Query qry = testStore.getSession().createQuery( - "select e from BookAuditing e where pages=1 and author=:author"); + "select e from " + getAuditEntityName("Book") + " e where pages=1 and author=:author"); qry.setParameter("author", vp.getIdString(w)); final List<?> list = qry.list(); assertTrue(list.size() == 1); @@ -356,4 +358,8 @@ public class SimpleLibraryAuditingAction extends AbstractTestAction { store.commitTransaction(); } } + + protected String getAuditEntityName(String eClassName) { + return eClassName + "Auditing"; + } }
\ No newline at end of file |