Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormtaal2006-07-06 01:10:37 -0400
committermtaal2006-07-06 01:10:37 -0400
commit12bebbf44fd4f3c59ac4fdf6f356e6cea81aa534 (patch)
tree44daa8d52a7293700f17b92f9b61324a028d70d5
parent95c5b04972a89e632ae26e1fa86af97edd3e43e7 (diff)
downloadorg.eclipse.emf.teneo-12bebbf44fd4f3c59ac4fdf6f356e6cea81aa534.tar.gz
org.eclipse.emf.teneo-12bebbf44fd4f3c59ac4fdf6f356e6cea81aa534.tar.xz
org.eclipse.emf.teneo-12bebbf44fd4f3c59ac4fdf6f356e6cea81aa534.zip
Initial Commit
-rw-r--r--tests/org.eclipse.emf.teneo.hibernate.test/.classpath7
-rw-r--r--tests/org.eclipse.emf.teneo.hibernate.test/.cvsignore1
-rw-r--r--tests/org.eclipse.emf.teneo.hibernate.test/.project28
-rw-r--r--tests/org.eclipse.emf.teneo.hibernate.test/META-INF/MANIFEST.MF13
-rw-r--r--tests/org.eclipse.emf.teneo.hibernate.test/about.html42
-rwxr-xr-xtests/org.eclipse.emf.teneo.hibernate.test/about.ini17
-rw-r--r--tests/org.eclipse.emf.teneo.hibernate.test/build.properties4
-rw-r--r--tests/org.eclipse.emf.teneo.hibernate.test/copyright.txt10
-rwxr-xr-xtests/org.eclipse.emf.teneo.hibernate.test/eclipse32.pngbin0 -> 4594 bytes
-rw-r--r--tests/org.eclipse.emf.teneo.hibernate.test/epl-v10.html319
-rw-r--r--tests/org.eclipse.emf.teneo.hibernate.test/license.html319
-rw-r--r--tests/org.eclipse.emf.teneo.hibernate.test/plugin.properties34
-rw-r--r--tests/org.eclipse.emf.teneo.hibernate.test/src/dbadapters.properties74
-rw-r--r--tests/org.eclipse.emf.teneo.hibernate.test/src/org/eclipse/emf/teneo/hibernate/test/AllTests.java43
-rw-r--r--tests/org.eclipse.emf.teneo.hibernate.test/src/org/eclipse/emf/teneo/hibernate/test/HibernateTestbed.java125
-rw-r--r--tests/org.eclipse.emf.teneo.hibernate.test/src/org/eclipse/emf/teneo/hibernate/test/emf/annotations/AllTests.java97
-rw-r--r--tests/org.eclipse.emf.teneo.hibernate.test/src/org/eclipse/emf/teneo/hibernate/test/emf/annotations/JoinColumnsTest.java74
-rw-r--r--tests/org.eclipse.emf.teneo.hibernate.test/src/org/eclipse/emf/teneo/hibernate/test/emf/annotations/UserTypeAction.java77
-rw-r--r--tests/org.eclipse.emf.teneo.hibernate.test/src/org/eclipse/emf/teneo/hibernate/test/emf/detach/AllTests.java42
-rw-r--r--tests/org.eclipse.emf.teneo.hibernate.test/src/org/eclipse/emf/teneo/hibernate/test/emf/detach/DetachFeatureMapTest.java41
-rw-r--r--tests/org.eclipse.emf.teneo.hibernate.test/src/org/eclipse/emf/teneo/hibernate/test/emf/detach/DetachTest.java41
-rw-r--r--tests/org.eclipse.emf.teneo.hibernate.test/src/org/eclipse/emf/teneo/hibernate/test/emf/elist/AllTests.java45
-rw-r--r--tests/org.eclipse.emf.teneo.hibernate.test/src/org/eclipse/emf/teneo/hibernate/test/emf/relation/AllTests.java49
-rw-r--r--tests/org.eclipse.emf.teneo.hibernate.test/src/org/eclipse/emf/teneo/hibernate/test/emf/sample/AccountingTest.java64
-rw-r--r--tests/org.eclipse.emf.teneo.hibernate.test/src/org/eclipse/emf/teneo/hibernate/test/emf/sample/AllTests.java78
-rw-r--r--tests/org.eclipse.emf.teneo.hibernate.test/src/org/eclipse/emf/teneo/hibernate/test/emf/sample/CatalogTest.java40
-rw-r--r--tests/org.eclipse.emf.teneo.hibernate.test/src/org/eclipse/emf/teneo/hibernate/test/emf/sample/ExtendedPO2Test.java40
-rw-r--r--tests/org.eclipse.emf.teneo.hibernate.test/src/org/eclipse/emf/teneo/hibernate/test/emf/sample/LibraryTest.java51
-rw-r--r--tests/org.eclipse.emf.teneo.hibernate.test/src/org/eclipse/emf/teneo/hibernate/test/emf/sample/LibraryValidateResourceTest.java57
-rw-r--r--tests/org.eclipse.emf.teneo.hibernate.test/src/org/eclipse/emf/teneo/hibernate/test/emf/sample/PlayImExportTest.java60
-rw-r--r--tests/org.eclipse.emf.teneo.hibernate.test/src/org/eclipse/emf/teneo/hibernate/test/emf/sample/SchoolLibraryTest.java60
-rw-r--r--tests/org.eclipse.emf.teneo.hibernate.test/src/org/eclipse/emf/teneo/hibernate/test/emf/schemaconstructs/AllTests.java68
-rw-r--r--tests/org.eclipse.emf.teneo.hibernate.test/src/org/eclipse/emf/teneo/hibernate/test/emf/schemaconstructs/AttributesTest.java41
-rw-r--r--tests/org.eclipse.emf.teneo.hibernate.test/src/org/eclipse/emf/teneo/hibernate/test/issues/AllTests.java69
-rw-r--r--tests/org.eclipse.emf.teneo.hibernate.test/src/org/eclipse/emf/teneo/hibernate/test/stores/HibernateTestStore.java417
-rw-r--r--tests/org.eclipse.emf.teneo.hibernate.test/src/org/eclipse/emf/teneo/hibernate/test/stores/HibernateTestStoreFactory.java40
-rw-r--r--tests/org.eclipse.emf.teneo.hibernate.test/src/org/eclipse/emf/teneo/hibernate/test/stores/adapters/HibernateHsqlDBAdapter.java35
-rw-r--r--tests/org.eclipse.emf.teneo.hibernate.test/src/org/eclipse/emf/teneo/hibernate/test/stores/adapters/HibernateMcssqlDBAdapter.java35
-rw-r--r--tests/org.eclipse.emf.teneo.hibernate.test/src/org/eclipse/emf/teneo/hibernate/test/stores/adapters/HibernateMssqlDBAdapter.java35
-rw-r--r--tests/org.eclipse.emf.teneo.hibernate.test/src/org/eclipse/emf/teneo/hibernate/test/stores/adapters/HibernateMysqlDBAdapter.java36
-rw-r--r--tests/org.eclipse.emf.teneo.hibernate.test/src/org/eclipse/emf/teneo/hibernate/test/stores/adapters/HibernatePgsqlDBAdapter.java35
-rw-r--r--tests/org.eclipse.emf.teneo.hibernate.test/src/org/eclipse/emf/teneo/hibernate/test/stores/adapters/HibernateTestDBAdapter.java9
-rw-r--r--tests/org.eclipse.emf.teneo.hibernate.test/src/org/eclipse/emf/teneo/hibernate/test/test/AllTests.java39
-rw-r--r--tests/org.eclipse.emf.teneo.hibernate.test/src/org/eclipse/emf/teneo/samples/emf/hibernate/usertype/Name.java53
-rw-r--r--tests/org.eclipse.emf.teneo.hibernate.test/src/org/eclipse/emf/teneo/samples/emf/hibernate/usertype/NameType.java74
-rw-r--r--tests/org.eclipse.emf.teneo.hibernate.test/src/org/eclipse/emf/teneo/samples/emf/hibernate/usertype/Person.java55
-rw-r--r--tests/org.eclipse.emf.teneo.hibernate.test/src/org/eclipse/emf/teneo/samples/emf/hibernate/usertype/UsertypeFactory.java46
-rw-r--r--tests/org.eclipse.emf.teneo.hibernate.test/src/org/eclipse/emf/teneo/samples/emf/hibernate/usertype/UsertypePackage.java192
-rw-r--r--tests/org.eclipse.emf.teneo.hibernate.test/src/org/eclipse/emf/teneo/samples/emf/hibernate/usertype/impl/PersonImpl.java165
-rw-r--r--tests/org.eclipse.emf.teneo.hibernate.test/src/org/eclipse/emf/teneo/samples/emf/hibernate/usertype/impl/UsertypeFactoryImpl.java147
-rw-r--r--tests/org.eclipse.emf.teneo.hibernate.test/src/org/eclipse/emf/teneo/samples/emf/hibernate/usertype/impl/UsertypePackageImpl.java315
-rw-r--r--tests/org.eclipse.emf.teneo.hibernate.test/src/org/eclipse/emf/teneo/samples/emf/hibernate/usertype/model/UserType.genmodel14
-rw-r--r--tests/org.eclipse.emf.teneo.hibernate.test/src/org/eclipse/emf/teneo/samples/emf/hibernate/usertype/model/UserType.xsd22
-rw-r--r--tests/org.eclipse.emf.teneo.hibernate.test/src/org/eclipse/emf/teneo/samples/emf/hibernate/usertype/model/usertype.ecore36
-rw-r--r--tests/org.eclipse.emf.teneo.hibernate.test/src/org/eclipse/emf/teneo/samples/emf/hibernate/usertype/util/UsertypeAdapterFactory.java120
-rw-r--r--tests/org.eclipse.emf.teneo.hibernate.test/src/org/eclipse/emf/teneo/samples/emf/hibernate/usertype/util/UsertypeResourceFactoryImpl.java55
-rw-r--r--tests/org.eclipse.emf.teneo.hibernate.test/src/org/eclipse/emf/teneo/samples/emf/hibernate/usertype/util/UsertypeResourceImpl.java32
-rw-r--r--tests/org.eclipse.emf.teneo.hibernate.test/src/org/eclipse/emf/teneo/samples/emf/hibernate/usertype/util/UsertypeSwitch.java130
-rw-r--r--tests/org.eclipse.emf.teneo.hibernate.test/src/org/eclipse/emf/teneo/samples/emf/hibernate/usertype/util/UsertypeXMLProcessor.java50
-rw-r--r--tests/org.eclipse.emf.teneo.hibernate.test/src/test.properties29
60 files changed, 4346 insertions, 0 deletions
diff --git a/tests/org.eclipse.emf.teneo.hibernate.test/.classpath b/tests/org.eclipse.emf.teneo.hibernate.test/.classpath
new file mode 100644
index 000000000..751c8f2e5
--- /dev/null
+++ b/tests/org.eclipse.emf.teneo.hibernate.test/.classpath
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="src" path="src"/>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
+ <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+ <classpathentry kind="output" path="bin"/>
+</classpath>
diff --git a/tests/org.eclipse.emf.teneo.hibernate.test/.cvsignore b/tests/org.eclipse.emf.teneo.hibernate.test/.cvsignore
new file mode 100644
index 000000000..ba077a403
--- /dev/null
+++ b/tests/org.eclipse.emf.teneo.hibernate.test/.cvsignore
@@ -0,0 +1 @@
+bin
diff --git a/tests/org.eclipse.emf.teneo.hibernate.test/.project b/tests/org.eclipse.emf.teneo.hibernate.test/.project
new file mode 100644
index 000000000..fac6f54b3
--- /dev/null
+++ b/tests/org.eclipse.emf.teneo.hibernate.test/.project
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.eclipse.emf.teneo.hibernate.test</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.ManifestBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.SchemaBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.pde.PluginNature</nature>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ </natures>
+</projectDescription>
diff --git a/tests/org.eclipse.emf.teneo.hibernate.test/META-INF/MANIFEST.MF b/tests/org.eclipse.emf.teneo.hibernate.test/META-INF/MANIFEST.MF
new file mode 100644
index 000000000..2358e6db1
--- /dev/null
+++ b/tests/org.eclipse.emf.teneo.hibernate.test/META-INF/MANIFEST.MF
@@ -0,0 +1,13 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: $Plugin.name
+Bundle-SymbolicName: org.eclipse.emf.teneo.hibernate.test
+Bundle-Version: 0.7.5.qualifier
+Bundle-Vendor: $Plugin.providerName
+Bundle-Localization: plugin
+Require-Bundle: org.eclipse.emf.teneo.commontest,
+ org.eclipse.emf.ecore,
+ org.junit,
+ org.eclipse.emf.teneo.hibernate,
+ org.eclipse.emf.teneo.hibernate.libraries,
+ org.eclipse.emf.ecore.xmi
diff --git a/tests/org.eclipse.emf.teneo.hibernate.test/about.html b/tests/org.eclipse.emf.teneo.hibernate.test/about.html
new file mode 100644
index 000000000..e6350a025
--- /dev/null
+++ b/tests/org.eclipse.emf.teneo.hibernate.test/about.html
@@ -0,0 +1,42 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html>
+
+ <head>
+
+ <meta content="text/html; charset=ISO-8859-1"
+ http-equiv="Content-Type"/>
+
+ <title>About</title>
+
+ </head>
+
+ <body lang="EN-US">
+
+ <h2>About This Content</h2>
+
+ <p>January 22, 2006</p>
+
+ <h3>License</h3>
+
+ <p>The Eclipse Foundation makes available all content in this
+ plug-in (&quot;Content&quot;). Unless otherwise indicated below,
+ the Content is provided to you under the terms and conditions of
+ the Eclipse Public License Version 1.0 (&quot;EPL&quot;). A copy of
+ the EPL is available at
+ <a href="http://www.eclipse.org/legal/epl-v10.html">
+ http://www.eclipse.org/legal/epl-v10.html</a>. For purposes of the
+ EPL, &quot;Program&quot; will mean the Content.</p>
+
+ <p>If you did not receive this Content directly from the Eclipse
+ Foundation, the Content is being redistributed by another party
+ (&quot;Redistributor&quot;) and different terms and conditions may
+ apply to your use of any object code in the Content. Check the
+ Redistributor&apos;s license that was provided with the Content. If
+ no such license exists, contact the Redistributor. Unless otherwise
+ indicated below, the terms and conditions of the EPL still apply to
+ any source code in the Content.</p>
+
+ </body>
+
+</html>
+
diff --git a/tests/org.eclipse.emf.teneo.hibernate.test/about.ini b/tests/org.eclipse.emf.teneo.hibernate.test/about.ini
new file mode 100755
index 000000000..7dc454e5c
--- /dev/null
+++ b/tests/org.eclipse.emf.teneo.hibernate.test/about.ini
@@ -0,0 +1,17 @@
+# about.ini
+# contains information about a feature
+# java.io.Properties file (ISO 8859-1 with "\" escapes)
+# "%key" are externalized strings defined in about.properties
+# This file does not need to be translated.
+
+# Property "aboutText" contains blurb for "About" dialog (translated)
+aboutText=%featureText
+
+# Property "featureImage" contains path to feature image (32x32)
+featureImage=eclipse32.png
+
+# Property "appName" contains name of the application (translated)
+appName=%featureName
+
+# Property "welcomePage" contains path to welcome page (special XML-based format)
+#welcomePage=$nl$/welcome.xml
diff --git a/tests/org.eclipse.emf.teneo.hibernate.test/build.properties b/tests/org.eclipse.emf.teneo.hibernate.test/build.properties
new file mode 100644
index 000000000..34d2e4d2d
--- /dev/null
+++ b/tests/org.eclipse.emf.teneo.hibernate.test/build.properties
@@ -0,0 +1,4 @@
+source.. = src/
+output.. = bin/
+bin.includes = META-INF/,\
+ .
diff --git a/tests/org.eclipse.emf.teneo.hibernate.test/copyright.txt b/tests/org.eclipse.emf.teneo.hibernate.test/copyright.txt
new file mode 100644
index 000000000..bc13383fe
--- /dev/null
+++ b/tests/org.eclipse.emf.teneo.hibernate.test/copyright.txt
@@ -0,0 +1,10 @@
+Copyright (c) 2005, 2006 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
+ Davide Marchignoli
+ Laurens Fridael \ No newline at end of file
diff --git a/tests/org.eclipse.emf.teneo.hibernate.test/eclipse32.png b/tests/org.eclipse.emf.teneo.hibernate.test/eclipse32.png
new file mode 100755
index 000000000..568fac1d0
--- /dev/null
+++ b/tests/org.eclipse.emf.teneo.hibernate.test/eclipse32.png
Binary files differ
diff --git a/tests/org.eclipse.emf.teneo.hibernate.test/epl-v10.html b/tests/org.eclipse.emf.teneo.hibernate.test/epl-v10.html
new file mode 100644
index 000000000..d7b88e941
--- /dev/null
+++ b/tests/org.eclipse.emf.teneo.hibernate.test/epl-v10.html
@@ -0,0 +1,319 @@
+<html xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns="http://www.w3.org/TR/REC-html40"><head>
+<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
+<meta name="ProgId" content="Word.Document">
+<meta name="Generator" content="Microsoft Word 9">
+<meta name="Originator" content="Microsoft Word 9">
+<link rel="File-List" href="http://www.eclipse.org/org/documents/Eclipse%20EPL%202003_11_10%20Final_files/filelist.xml"><title>Eclipse Public License - Version 1.0</title><!--[if gte mso 9]><xml>
+ <o:DocumentProperties>
+ <o:Revision>2</o:Revision>
+ <o:TotalTime>3</o:TotalTime>
+ <o:Created>2004-03-05T23:03:00Z</o:Created>
+ <o:LastSaved>2004-03-05T23:03:00Z</o:LastSaved>
+ <o:Pages>4</o:Pages>
+ <o:Words>1626</o:Words>
+ <o:Characters>9270</o:Characters>
+ <o:Lines>77</o:Lines>
+ <o:Paragraphs>18</o:Paragraphs>
+ <o:CharactersWithSpaces>11384</o:CharactersWithSpaces>
+ <o:Version>9.4402</o:Version>
+ </o:DocumentProperties>
+</xml><![endif]--><!--[if gte mso 9]><xml>
+ <w:WordDocument>
+ <w:TrackRevisions/>
+ </w:WordDocument>
+</xml><![endif]-->
+
+
+<style>
+<!--
+ /* Font Definitions */
+@font-face
+ {font-family:Tahoma;
+ panose-1:2 11 6 4 3 5 4 4 2 4;
+ mso-font-charset:0;
+ mso-generic-font-family:swiss;
+ mso-font-pitch:variable;
+ mso-font-signature:553679495 -2147483648 8 0 66047 0;}
+ /* Style Definitions */
+p.MsoNormal, li.MsoNormal, div.MsoNormal
+ {mso-style-parent:"";
+ margin:0in;
+ margin-bottom:.0001pt;
+ mso-pagination:widow-orphan;
+ font-size:12.0pt;
+ font-family:"Times New Roman";
+ mso-fareast-font-family:"Times New Roman";}
+p
+ {margin-right:0in;
+ mso-margin-top-alt:auto;
+ mso-margin-bottom-alt:auto;
+ margin-left:0in;
+ mso-pagination:widow-orphan;
+ font-size:12.0pt;
+ font-family:"Times New Roman";
+ mso-fareast-font-family:"Times New Roman";}
+p.BalloonText, li.BalloonText, div.BalloonText
+ {mso-style-name:"Balloon Text";
+ margin:0in;
+ margin-bottom:.0001pt;
+ mso-pagination:widow-orphan;
+ font-size:8.0pt;
+ font-family:Tahoma;
+ mso-fareast-font-family:"Times New Roman";}
+@page Section1
+ {size:8.5in 11.0in;
+ margin:1.0in 1.25in 1.0in 1.25in;
+ mso-header-margin:.5in;
+ mso-footer-margin:.5in;
+ mso-paper-source:0;}
+div.Section1
+ {page:Section1;}
+-->
+</style></head>
+
+<body style="" lang="EN-US">
+
+<div class="Section1">
+
+<p style="text-align: center;" align="center"><b>Eclipse Public License - v 1.0</b>
+</p>
+
+<p><span style="font-size: 10pt;">THE ACCOMPANYING PROGRAM IS PROVIDED UNDER
+THE TERMS OF THIS ECLIPSE PUBLIC LICENSE ("AGREEMENT"). ANY USE,
+REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES RECIPIENT'S ACCEPTANCE
+OF THIS AGREEMENT.</span> </p>
+
+<p><b><span style="font-size: 10pt;">1. DEFINITIONS</span></b> </p>
+
+<p><span style="font-size: 10pt;">"Contribution" means:</span> </p>
+
+<p class="MsoNormal" style="margin-left: 0.5in;"><span style="font-size: 10pt;">a)
+in the case of the initial Contributor, the initial code and documentation
+distributed under this Agreement, and<br clear="left">
+b) in the case of each subsequent Contributor:</span></p>
+
+<p class="MsoNormal" style="margin-left: 0.5in;"><span style="font-size: 10pt;">i)
+changes to the Program, and</span></p>
+
+<p class="MsoNormal" style="margin-left: 0.5in;"><span style="font-size: 10pt;">ii)
+additions to the Program;</span></p>
+
+<p class="MsoNormal" style="margin-left: 0.5in;"><span style="font-size: 10pt;">where
+such changes and/or additions to the Program originate from and are distributed
+by that particular Contributor. A Contribution 'originates' from a Contributor
+if it was added to the Program by such Contributor itself or anyone acting on
+such Contributor's behalf. Contributions do not include additions to the
+Program which: (i) are separate modules of software distributed in conjunction
+with the Program under their own license agreement, and (ii) are not derivative
+works of the Program. </span></p>
+
+<p><span style="font-size: 10pt;">"Contributor" means any person or
+entity that distributes the Program.</span> </p>
+
+<p><span style="font-size: 10pt;">"Licensed Patents " mean patent
+claims licensable by a Contributor which are necessarily infringed by the use
+or sale of its Contribution alone or when combined with the Program. </span></p>
+
+<p><span style="font-size: 10pt;">"Program" means the Contributions
+distributed in accordance with this Agreement.</span> </p>
+
+<p><span style="font-size: 10pt;">"Recipient" means anyone who
+receives the Program under this Agreement, including all Contributors.</span> </p>
+
+<p><b><span style="font-size: 10pt;">2. GRANT OF RIGHTS</span></b> </p>
+
+<p class="MsoNormal" style="margin-left: 0.5in;"><span style="font-size: 10pt;">a)
+Subject to the terms of this Agreement, each Contributor hereby grants Recipient
+a non-exclusive, worldwide, royalty-free copyright license to<span style="color: red;"> </span>reproduce, prepare derivative works of, publicly
+display, publicly perform, distribute and sublicense the Contribution of such
+Contributor, if any, and such derivative works, in source code and object code
+form.</span></p>
+
+<p class="MsoNormal" style="margin-left: 0.5in;"><span style="font-size: 10pt;">b)
+Subject to the terms of this Agreement, each Contributor hereby grants
+Recipient a non-exclusive, worldwide,<span style="color: green;"> </span>royalty-free
+patent license under Licensed Patents to make, use, sell, offer to sell, import
+and otherwise transfer the Contribution of such Contributor, if any, in source
+code and object code form. This patent license shall apply to the combination
+of the Contribution and the Program if, at the time the Contribution is added
+by the Contributor, such addition of the Contribution causes such combination
+to be covered by the Licensed Patents. The patent license shall not apply to
+any other combinations which include the Contribution. No hardware per se is
+licensed hereunder. </span></p>
+
+<p class="MsoNormal" style="margin-left: 0.5in;"><span style="font-size: 10pt;">c)
+Recipient understands that although each Contributor grants the licenses to its
+Contributions set forth herein, no assurances are provided by any Contributor
+that the Program does not infringe the patent or other intellectual property
+rights of any other entity. Each Contributor disclaims any liability to Recipient
+for claims brought by any other entity based on infringement of intellectual
+property rights or otherwise. As a condition to exercising the rights and
+licenses granted hereunder, each Recipient hereby assumes sole responsibility
+to secure any other intellectual property rights needed, if any. For example,
+if a third party patent license is required to allow Recipient to distribute
+the Program, it is Recipient's responsibility to acquire that license before
+distributing the Program.</span></p>
+
+<p class="MsoNormal" style="margin-left: 0.5in;"><span style="font-size: 10pt;">d)
+Each Contributor represents that to its knowledge it has sufficient copyright
+rights in its Contribution, if any, to grant the copyright license set forth in
+this Agreement. </span></p>
+
+<p><b><span style="font-size: 10pt;">3. REQUIREMENTS</span></b> </p>
+
+<p><span style="font-size: 10pt;">A Contributor may choose to distribute the
+Program in object code form under its own license agreement, provided that:</span>
+</p>
+
+<p class="MsoNormal" style="margin-left: 0.5in;"><span style="font-size: 10pt;">a)
+it complies with the terms and conditions of this Agreement; and</span></p>
+
+<p class="MsoNormal" style="margin-left: 0.5in;"><span style="font-size: 10pt;">b)
+its license agreement:</span></p>
+
+<p class="MsoNormal" style="margin-left: 0.5in;"><span style="font-size: 10pt;">i)
+effectively disclaims on behalf of all Contributors all warranties and
+conditions, express and implied, including warranties or conditions of title
+and non-infringement, and implied warranties or conditions of merchantability
+and fitness for a particular purpose; </span></p>
+
+<p class="MsoNormal" style="margin-left: 0.5in;"><span style="font-size: 10pt;">ii)
+effectively excludes on behalf of all Contributors all liability for damages,
+including direct, indirect, special, incidental and consequential damages, such
+as lost profits; </span></p>
+
+<p class="MsoNormal" style="margin-left: 0.5in;"><span style="font-size: 10pt;">iii)
+states that any provisions which differ from this Agreement are offered by that
+Contributor alone and not by any other party; and</span></p>
+
+<p class="MsoNormal" style="margin-left: 0.5in;"><span style="font-size: 10pt;">iv)
+states that source code for the Program is available from such Contributor, and
+informs licensees how to obtain it in a reasonable manner on or through a
+medium customarily used for software exchange.<span style="color: blue;"> </span></span></p>
+
+<p><span style="font-size: 10pt;">When the Program is made available in source
+code form:</span> </p>
+
+<p class="MsoNormal" style="margin-left: 0.5in;"><span style="font-size: 10pt;">a)
+it must be made available under this Agreement; and </span></p>
+
+<p class="MsoNormal" style="margin-left: 0.5in;"><span style="font-size: 10pt;">b) a
+copy of this Agreement must be included with each copy of the Program. </span></p>
+
+<p><span style="font-size: 10pt;">Contributors may not remove or alter any
+copyright notices contained within the Program. </span></p>
+
+<p><span style="font-size: 10pt;">Each Contributor must identify itself as the
+originator of its Contribution, if any, in a manner that reasonably allows
+subsequent Recipients to identify the originator of the Contribution. </span></p>
+
+<p><b><span style="font-size: 10pt;">4. COMMERCIAL DISTRIBUTION</span></b> </p>
+
+<p><span style="font-size: 10pt;">Commercial distributors of software may
+accept certain responsibilities with respect to end users, business partners
+and the like. While this license is intended to facilitate the commercial use
+of the Program, the Contributor who includes the Program in a commercial
+product offering should do so in a manner which does not create potential
+liability for other Contributors. Therefore, if a Contributor includes the
+Program in a commercial product offering, such Contributor ("Commercial
+Contributor") hereby agrees to defend and indemnify every other
+Contributor ("Indemnified Contributor") against any losses, damages and
+costs (collectively "Losses") arising from claims, lawsuits and other
+legal actions brought by a third party against the Indemnified Contributor to
+the extent caused by the acts or omissions of such Commercial Contributor in
+connection with its distribution of the Program in a commercial product
+offering. The obligations in this section do not apply to any claims or Losses
+relating to any actual or alleged intellectual property infringement. In order
+to qualify, an Indemnified Contributor must: a) promptly notify the Commercial
+Contributor in writing of such claim, and b) allow the Commercial Contributor
+to control, and cooperate with the Commercial Contributor in, the defense and
+any related settlement negotiations. The Indemnified Contributor may participate
+in any such claim at its own expense.</span> </p>
+
+<p><span style="font-size: 10pt;">For example, a Contributor might include the
+Program in a commercial product offering, Product X. That Contributor is then a
+Commercial Contributor. If that Commercial Contributor then makes performance
+claims, or offers warranties related to Product X, those performance claims and
+warranties are such Commercial Contributor's responsibility alone. Under this
+section, the Commercial Contributor would have to defend claims against the
+other Contributors related to those performance claims and warranties, and if a
+court requires any other Contributor to pay any damages as a result, the
+Commercial Contributor must pay those damages.</span> </p>
+
+<p><b><span style="font-size: 10pt;">5. NO WARRANTY</span></b> </p>
+
+<p><span style="font-size: 10pt;">EXCEPT AS EXPRESSLY SET FORTH IN THIS
+AGREEMENT, THE PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT
+WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED INCLUDING,
+WITHOUT LIMITATION, ANY WARRANTIES OR CONDITIONS OF TITLE, NON-INFRINGEMENT,
+MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. Each Recipient is solely
+responsible for determining the appropriateness of using and distributing the
+Program and assumes all risks associated with its exercise of rights under this
+Agreement , including but not limited to the risks and costs of program errors,
+compliance with applicable laws, damage to or loss of data, programs or
+equipment, and unavailability or interruption of operations. </span></p>
+
+<p><b><span style="font-size: 10pt;">6. DISCLAIMER OF LIABILITY</span></b> </p>
+
+<p><span style="font-size: 10pt;">EXCEPT AS EXPRESSLY SET FORTH IN THIS
+AGREEMENT, NEITHER RECIPIENT NOR ANY CONTRIBUTORS SHALL HAVE ANY LIABILITY FOR
+ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+(INCLUDING WITHOUT LIMITATION LOST PROFITS), HOWEVER CAUSED AND ON ANY THEORY
+OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OR DISTRIBUTION OF
+THE PROGRAM OR THE EXERCISE OF ANY RIGHTS GRANTED HEREUNDER, EVEN IF ADVISED OF
+THE POSSIBILITY OF SUCH DAMAGES.</span> </p>
+
+<p><b><span style="font-size: 10pt;">7. GENERAL</span></b> </p>
+
+<p><span style="font-size: 10pt;">If any provision of this Agreement is invalid
+or unenforceable under applicable law, it shall not affect the validity or
+enforceability of the remainder of the terms of this Agreement, and without
+further action by the parties hereto, such provision shall be reformed to the
+minimum extent necessary to make such provision valid and enforceable.</span> </p>
+
+<p><span style="font-size: 10pt;">If Recipient institutes patent litigation
+against any entity (including a cross-claim or counterclaim in a lawsuit)
+alleging that the Program itself (excluding combinations of the Program with
+other software or hardware) infringes such Recipient's patent(s), then such
+Recipient's rights granted under Section 2(b) shall terminate as of the date
+such litigation is filed. </span></p>
+
+<p><span style="font-size: 10pt;">All Recipient's rights under this Agreement
+shall terminate if it fails to comply with any of the material terms or
+conditions of this Agreement and does not cure such failure in a reasonable
+period of time after becoming aware of such noncompliance. If all Recipient's
+rights under this Agreement terminate, Recipient agrees to cease use and
+distribution of the Program as soon as reasonably practicable. However,
+Recipient's obligations under this Agreement and any licenses granted by
+Recipient relating to the Program shall continue and survive. </span></p>
+
+<p><span style="font-size: 10pt;">Everyone is permitted to copy and distribute
+copies of this Agreement, but in order to avoid inconsistency the Agreement is
+copyrighted and may only be modified in the following manner. The Agreement
+Steward reserves the right to publish new versions (including revisions) of
+this Agreement from time to time. No one other than the Agreement Steward has
+the right to modify this Agreement. The Eclipse Foundation is the initial
+Agreement Steward. The Eclipse Foundation may assign the responsibility to
+serve as the Agreement Steward to a suitable separate entity. Each new version
+of the Agreement will be given a distinguishing version number. The Program
+(including Contributions) may always be distributed subject to the version of
+the Agreement under which it was received. In addition, after a new version of
+the Agreement is published, Contributor may elect to distribute the Program
+(including its Contributions) under the new version. Except as expressly stated
+in Sections 2(a) and 2(b) above, Recipient receives no rights or licenses to
+the intellectual property of any Contributor under this Agreement, whether
+expressly, by implication, estoppel or otherwise. All rights in the Program not
+expressly granted under this Agreement are reserved.</span> </p>
+
+<p><span style="font-size: 10pt;">This Agreement is governed by the laws of the
+State of New York and the intellectual property laws of the United States of
+America. No party to this Agreement will bring a legal action under this
+Agreement more than one year after the cause of action arose. Each party waives
+its rights to a jury trial in any resulting litigation.</span> </p>
+
+<p class="MsoNormal"><!--[if !supportEmptyParas]-->&nbsp;<!--[endif]--><o:p></o:p></p>
+
+</div>
+
+</body></html> \ No newline at end of file
diff --git a/tests/org.eclipse.emf.teneo.hibernate.test/license.html b/tests/org.eclipse.emf.teneo.hibernate.test/license.html
new file mode 100644
index 000000000..d7b88e941
--- /dev/null
+++ b/tests/org.eclipse.emf.teneo.hibernate.test/license.html
@@ -0,0 +1,319 @@
+<html xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns="http://www.w3.org/TR/REC-html40"><head>
+<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
+<meta name="ProgId" content="Word.Document">
+<meta name="Generator" content="Microsoft Word 9">
+<meta name="Originator" content="Microsoft Word 9">
+<link rel="File-List" href="http://www.eclipse.org/org/documents/Eclipse%20EPL%202003_11_10%20Final_files/filelist.xml"><title>Eclipse Public License - Version 1.0</title><!--[if gte mso 9]><xml>
+ <o:DocumentProperties>
+ <o:Revision>2</o:Revision>
+ <o:TotalTime>3</o:TotalTime>
+ <o:Created>2004-03-05T23:03:00Z</o:Created>
+ <o:LastSaved>2004-03-05T23:03:00Z</o:LastSaved>
+ <o:Pages>4</o:Pages>
+ <o:Words>1626</o:Words>
+ <o:Characters>9270</o:Characters>
+ <o:Lines>77</o:Lines>
+ <o:Paragraphs>18</o:Paragraphs>
+ <o:CharactersWithSpaces>11384</o:CharactersWithSpaces>
+ <o:Version>9.4402</o:Version>
+ </o:DocumentProperties>
+</xml><![endif]--><!--[if gte mso 9]><xml>
+ <w:WordDocument>
+ <w:TrackRevisions/>
+ </w:WordDocument>
+</xml><![endif]-->
+
+
+<style>
+<!--
+ /* Font Definitions */
+@font-face
+ {font-family:Tahoma;
+ panose-1:2 11 6 4 3 5 4 4 2 4;
+ mso-font-charset:0;
+ mso-generic-font-family:swiss;
+ mso-font-pitch:variable;
+ mso-font-signature:553679495 -2147483648 8 0 66047 0;}
+ /* Style Definitions */
+p.MsoNormal, li.MsoNormal, div.MsoNormal
+ {mso-style-parent:"";
+ margin:0in;
+ margin-bottom:.0001pt;
+ mso-pagination:widow-orphan;
+ font-size:12.0pt;
+ font-family:"Times New Roman";
+ mso-fareast-font-family:"Times New Roman";}
+p
+ {margin-right:0in;
+ mso-margin-top-alt:auto;
+ mso-margin-bottom-alt:auto;
+ margin-left:0in;
+ mso-pagination:widow-orphan;
+ font-size:12.0pt;
+ font-family:"Times New Roman";
+ mso-fareast-font-family:"Times New Roman";}
+p.BalloonText, li.BalloonText, div.BalloonText
+ {mso-style-name:"Balloon Text";
+ margin:0in;
+ margin-bottom:.0001pt;
+ mso-pagination:widow-orphan;
+ font-size:8.0pt;
+ font-family:Tahoma;
+ mso-fareast-font-family:"Times New Roman";}
+@page Section1
+ {size:8.5in 11.0in;
+ margin:1.0in 1.25in 1.0in 1.25in;
+ mso-header-margin:.5in;
+ mso-footer-margin:.5in;
+ mso-paper-source:0;}
+div.Section1
+ {page:Section1;}
+-->
+</style></head>
+
+<body style="" lang="EN-US">
+
+<div class="Section1">
+
+<p style="text-align: center;" align="center"><b>Eclipse Public License - v 1.0</b>
+</p>
+
+<p><span style="font-size: 10pt;">THE ACCOMPANYING PROGRAM IS PROVIDED UNDER
+THE TERMS OF THIS ECLIPSE PUBLIC LICENSE ("AGREEMENT"). ANY USE,
+REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES RECIPIENT'S ACCEPTANCE
+OF THIS AGREEMENT.</span> </p>
+
+<p><b><span style="font-size: 10pt;">1. DEFINITIONS</span></b> </p>
+
+<p><span style="font-size: 10pt;">"Contribution" means:</span> </p>
+
+<p class="MsoNormal" style="margin-left: 0.5in;"><span style="font-size: 10pt;">a)
+in the case of the initial Contributor, the initial code and documentation
+distributed under this Agreement, and<br clear="left">
+b) in the case of each subsequent Contributor:</span></p>
+
+<p class="MsoNormal" style="margin-left: 0.5in;"><span style="font-size: 10pt;">i)
+changes to the Program, and</span></p>
+
+<p class="MsoNormal" style="margin-left: 0.5in;"><span style="font-size: 10pt;">ii)
+additions to the Program;</span></p>
+
+<p class="MsoNormal" style="margin-left: 0.5in;"><span style="font-size: 10pt;">where
+such changes and/or additions to the Program originate from and are distributed
+by that particular Contributor. A Contribution 'originates' from a Contributor
+if it was added to the Program by such Contributor itself or anyone acting on
+such Contributor's behalf. Contributions do not include additions to the
+Program which: (i) are separate modules of software distributed in conjunction
+with the Program under their own license agreement, and (ii) are not derivative
+works of the Program. </span></p>
+
+<p><span style="font-size: 10pt;">"Contributor" means any person or
+entity that distributes the Program.</span> </p>
+
+<p><span style="font-size: 10pt;">"Licensed Patents " mean patent
+claims licensable by a Contributor which are necessarily infringed by the use
+or sale of its Contribution alone or when combined with the Program. </span></p>
+
+<p><span style="font-size: 10pt;">"Program" means the Contributions
+distributed in accordance with this Agreement.</span> </p>
+
+<p><span style="font-size: 10pt;">"Recipient" means anyone who
+receives the Program under this Agreement, including all Contributors.</span> </p>
+
+<p><b><span style="font-size: 10pt;">2. GRANT OF RIGHTS</span></b> </p>
+
+<p class="MsoNormal" style="margin-left: 0.5in;"><span style="font-size: 10pt;">a)
+Subject to the terms of this Agreement, each Contributor hereby grants Recipient
+a non-exclusive, worldwide, royalty-free copyright license to<span style="color: red;"> </span>reproduce, prepare derivative works of, publicly
+display, publicly perform, distribute and sublicense the Contribution of such
+Contributor, if any, and such derivative works, in source code and object code
+form.</span></p>
+
+<p class="MsoNormal" style="margin-left: 0.5in;"><span style="font-size: 10pt;">b)
+Subject to the terms of this Agreement, each Contributor hereby grants
+Recipient a non-exclusive, worldwide,<span style="color: green;"> </span>royalty-free
+patent license under Licensed Patents to make, use, sell, offer to sell, import
+and otherwise transfer the Contribution of such Contributor, if any, in source
+code and object code form. This patent license shall apply to the combination
+of the Contribution and the Program if, at the time the Contribution is added
+by the Contributor, such addition of the Contribution causes such combination
+to be covered by the Licensed Patents. The patent license shall not apply to
+any other combinations which include the Contribution. No hardware per se is
+licensed hereunder. </span></p>
+
+<p class="MsoNormal" style="margin-left: 0.5in;"><span style="font-size: 10pt;">c)
+Recipient understands that although each Contributor grants the licenses to its
+Contributions set forth herein, no assurances are provided by any Contributor
+that the Program does not infringe the patent or other intellectual property
+rights of any other entity. Each Contributor disclaims any liability to Recipient
+for claims brought by any other entity based on infringement of intellectual
+property rights or otherwise. As a condition to exercising the rights and
+licenses granted hereunder, each Recipient hereby assumes sole responsibility
+to secure any other intellectual property rights needed, if any. For example,
+if a third party patent license is required to allow Recipient to distribute
+the Program, it is Recipient's responsibility to acquire that license before
+distributing the Program.</span></p>
+
+<p class="MsoNormal" style="margin-left: 0.5in;"><span style="font-size: 10pt;">d)
+Each Contributor represents that to its knowledge it has sufficient copyright
+rights in its Contribution, if any, to grant the copyright license set forth in
+this Agreement. </span></p>
+
+<p><b><span style="font-size: 10pt;">3. REQUIREMENTS</span></b> </p>
+
+<p><span style="font-size: 10pt;">A Contributor may choose to distribute the
+Program in object code form under its own license agreement, provided that:</span>
+</p>
+
+<p class="MsoNormal" style="margin-left: 0.5in;"><span style="font-size: 10pt;">a)
+it complies with the terms and conditions of this Agreement; and</span></p>
+
+<p class="MsoNormal" style="margin-left: 0.5in;"><span style="font-size: 10pt;">b)
+its license agreement:</span></p>
+
+<p class="MsoNormal" style="margin-left: 0.5in;"><span style="font-size: 10pt;">i)
+effectively disclaims on behalf of all Contributors all warranties and
+conditions, express and implied, including warranties or conditions of title
+and non-infringement, and implied warranties or conditions of merchantability
+and fitness for a particular purpose; </span></p>
+
+<p class="MsoNormal" style="margin-left: 0.5in;"><span style="font-size: 10pt;">ii)
+effectively excludes on behalf of all Contributors all liability for damages,
+including direct, indirect, special, incidental and consequential damages, such
+as lost profits; </span></p>
+
+<p class="MsoNormal" style="margin-left: 0.5in;"><span style="font-size: 10pt;">iii)
+states that any provisions which differ from this Agreement are offered by that
+Contributor alone and not by any other party; and</span></p>
+
+<p class="MsoNormal" style="margin-left: 0.5in;"><span style="font-size: 10pt;">iv)
+states that source code for the Program is available from such Contributor, and
+informs licensees how to obtain it in a reasonable manner on or through a
+medium customarily used for software exchange.<span style="color: blue;"> </span></span></p>
+
+<p><span style="font-size: 10pt;">When the Program is made available in source
+code form:</span> </p>
+
+<p class="MsoNormal" style="margin-left: 0.5in;"><span style="font-size: 10pt;">a)
+it must be made available under this Agreement; and </span></p>
+
+<p class="MsoNormal" style="margin-left: 0.5in;"><span style="font-size: 10pt;">b) a
+copy of this Agreement must be included with each copy of the Program. </span></p>
+
+<p><span style="font-size: 10pt;">Contributors may not remove or alter any
+copyright notices contained within the Program. </span></p>
+
+<p><span style="font-size: 10pt;">Each Contributor must identify itself as the
+originator of its Contribution, if any, in a manner that reasonably allows
+subsequent Recipients to identify the originator of the Contribution. </span></p>
+
+<p><b><span style="font-size: 10pt;">4. COMMERCIAL DISTRIBUTION</span></b> </p>
+
+<p><span style="font-size: 10pt;">Commercial distributors of software may
+accept certain responsibilities with respect to end users, business partners
+and the like. While this license is intended to facilitate the commercial use
+of the Program, the Contributor who includes the Program in a commercial
+product offering should do so in a manner which does not create potential
+liability for other Contributors. Therefore, if a Contributor includes the
+Program in a commercial product offering, such Contributor ("Commercial
+Contributor") hereby agrees to defend and indemnify every other
+Contributor ("Indemnified Contributor") against any losses, damages and
+costs (collectively "Losses") arising from claims, lawsuits and other
+legal actions brought by a third party against the Indemnified Contributor to
+the extent caused by the acts or omissions of such Commercial Contributor in
+connection with its distribution of the Program in a commercial product
+offering. The obligations in this section do not apply to any claims or Losses
+relating to any actual or alleged intellectual property infringement. In order
+to qualify, an Indemnified Contributor must: a) promptly notify the Commercial
+Contributor in writing of such claim, and b) allow the Commercial Contributor
+to control, and cooperate with the Commercial Contributor in, the defense and
+any related settlement negotiations. The Indemnified Contributor may participate
+in any such claim at its own expense.</span> </p>
+
+<p><span style="font-size: 10pt;">For example, a Contributor might include the
+Program in a commercial product offering, Product X. That Contributor is then a
+Commercial Contributor. If that Commercial Contributor then makes performance
+claims, or offers warranties related to Product X, those performance claims and
+warranties are such Commercial Contributor's responsibility alone. Under this
+section, the Commercial Contributor would have to defend claims against the
+other Contributors related to those performance claims and warranties, and if a
+court requires any other Contributor to pay any damages as a result, the
+Commercial Contributor must pay those damages.</span> </p>
+
+<p><b><span style="font-size: 10pt;">5. NO WARRANTY</span></b> </p>
+
+<p><span style="font-size: 10pt;">EXCEPT AS EXPRESSLY SET FORTH IN THIS
+AGREEMENT, THE PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT
+WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED INCLUDING,
+WITHOUT LIMITATION, ANY WARRANTIES OR CONDITIONS OF TITLE, NON-INFRINGEMENT,
+MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. Each Recipient is solely
+responsible for determining the appropriateness of using and distributing the
+Program and assumes all risks associated with its exercise of rights under this
+Agreement , including but not limited to the risks and costs of program errors,
+compliance with applicable laws, damage to or loss of data, programs or
+equipment, and unavailability or interruption of operations. </span></p>
+
+<p><b><span style="font-size: 10pt;">6. DISCLAIMER OF LIABILITY</span></b> </p>
+
+<p><span style="font-size: 10pt;">EXCEPT AS EXPRESSLY SET FORTH IN THIS
+AGREEMENT, NEITHER RECIPIENT NOR ANY CONTRIBUTORS SHALL HAVE ANY LIABILITY FOR
+ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+(INCLUDING WITHOUT LIMITATION LOST PROFITS), HOWEVER CAUSED AND ON ANY THEORY
+OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OR DISTRIBUTION OF
+THE PROGRAM OR THE EXERCISE OF ANY RIGHTS GRANTED HEREUNDER, EVEN IF ADVISED OF
+THE POSSIBILITY OF SUCH DAMAGES.</span> </p>
+
+<p><b><span style="font-size: 10pt;">7. GENERAL</span></b> </p>
+
+<p><span style="font-size: 10pt;">If any provision of this Agreement is invalid
+or unenforceable under applicable law, it shall not affect the validity or
+enforceability of the remainder of the terms of this Agreement, and without
+further action by the parties hereto, such provision shall be reformed to the
+minimum extent necessary to make such provision valid and enforceable.</span> </p>
+
+<p><span style="font-size: 10pt;">If Recipient institutes patent litigation
+against any entity (including a cross-claim or counterclaim in a lawsuit)
+alleging that the Program itself (excluding combinations of the Program with
+other software or hardware) infringes such Recipient's patent(s), then such
+Recipient's rights granted under Section 2(b) shall terminate as of the date
+such litigation is filed. </span></p>
+
+<p><span style="font-size: 10pt;">All Recipient's rights under this Agreement
+shall terminate if it fails to comply with any of the material terms or
+conditions of this Agreement and does not cure such failure in a reasonable
+period of time after becoming aware of such noncompliance. If all Recipient's
+rights under this Agreement terminate, Recipient agrees to cease use and
+distribution of the Program as soon as reasonably practicable. However,
+Recipient's obligations under this Agreement and any licenses granted by
+Recipient relating to the Program shall continue and survive. </span></p>
+
+<p><span style="font-size: 10pt;">Everyone is permitted to copy and distribute
+copies of this Agreement, but in order to avoid inconsistency the Agreement is
+copyrighted and may only be modified in the following manner. The Agreement
+Steward reserves the right to publish new versions (including revisions) of
+this Agreement from time to time. No one other than the Agreement Steward has
+the right to modify this Agreement. The Eclipse Foundation is the initial
+Agreement Steward. The Eclipse Foundation may assign the responsibility to
+serve as the Agreement Steward to a suitable separate entity. Each new version
+of the Agreement will be given a distinguishing version number. The Program
+(including Contributions) may always be distributed subject to the version of
+the Agreement under which it was received. In addition, after a new version of
+the Agreement is published, Contributor may elect to distribute the Program
+(including its Contributions) under the new version. Except as expressly stated
+in Sections 2(a) and 2(b) above, Recipient receives no rights or licenses to
+the intellectual property of any Contributor under this Agreement, whether
+expressly, by implication, estoppel or otherwise. All rights in the Program not
+expressly granted under this Agreement are reserved.</span> </p>
+
+<p><span style="font-size: 10pt;">This Agreement is governed by the laws of the
+State of New York and the intellectual property laws of the United States of
+America. No party to this Agreement will bring a legal action under this
+Agreement more than one year after the cause of action arose. Each party waives
+its rights to a jury trial in any resulting litigation.</span> </p>
+
+<p class="MsoNormal"><!--[if !supportEmptyParas]-->&nbsp;<!--[endif]--><o:p></o:p></p>
+
+</div>
+
+</body></html> \ No newline at end of file
diff --git a/tests/org.eclipse.emf.teneo.hibernate.test/plugin.properties b/tests/org.eclipse.emf.teneo.hibernate.test/plugin.properties
new file mode 100644
index 000000000..103411508
--- /dev/null
+++ b/tests/org.eclipse.emf.teneo.hibernate.test/plugin.properties
@@ -0,0 +1,34 @@
+#/**
+# * <copyright>
+# *
+# * Copyright (c) 2005, 2006 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 - Initial API and implementation
+# * Davide Marchignoli - Initial API and implementation
+# *
+# * </copyright>
+# *
+# * $Id: plugin.properties,v 1.1 2006/07/06 05:10:38 mtaal Exp $
+# */
+
+# NLS_MESSAGEFORMAT_VAR
+
+# ==============================================================================
+# Do not change the properties between this line and the last line containing:
+# %%% END OF TRANSLATED PROPERTIES %%%
+# Instead, either redefine an existing property, or create a new property,
+# append it to the end of the file, and change the code to use the new name.
+# ==============================================================================
+
+Plugin.name = Teneo Hibernate Test
+Plugin.providerName = Eclipse.org
+
+# ==============================================================================
+# %%% END OF TRANSLATED PROPERTIES %%%
+# The above properties have been shipped for translation.
+# ==============================================================================
diff --git a/tests/org.eclipse.emf.teneo.hibernate.test/src/dbadapters.properties b/tests/org.eclipse.emf.teneo.hibernate.test/src/dbadapters.properties
new file mode 100644
index 000000000..f8859d4fd
--- /dev/null
+++ b/tests/org.eclipse.emf.teneo.hibernate.test/src/dbadapters.properties
@@ -0,0 +1,74 @@
+#
+# Copyright 2004-2005, Elver.org (http://www.elver.org).
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+# ----------------------------------------------------------------------
+#
+
+# used to set database connection props in the test classes
+
+# database: sets for which database (connection info) the tests are run. Only one database should currently be specified!
+# optimistic can be true or false, currently false is more stable! true is experimental
+# *.dburl: the database url WITHOUT the database name.
+# *.dbuser: the database user
+# *.dbpassword: the password of the database user
+# *.dbdriver: the class name of the database driver
+# *.dbadapter: a org.eclipse.emf.teneo.test.stores.TestDatabaseAdapter or a subclass, if not set then
+# org.eclipse.emf.teneo.test.stores.MysqlDatabaseAdapter is used
+#
+# Note that the database name is not specified because this is set automatically
+
+mysql.dburl=jdbc:mysql://127.0.0.1:3306/
+mysql.dbuser=root
+mysql.dbpassword=root
+mysql.dbdriver=com.mysql.jdbc.Driver
+mysql.dbadapter=org.eclipse.emf.teneo.hibernate.test.stores.adapters.HibernateMysqlDBAdapter
+
+pgsql.dburl=jdbc:postgresql://localhost:5432/
+pgsql.dbuser=rt
+pgsql.dbpassword=rt
+pgsql.dbdriver=org.postgresql.Driver
+pgsql.dbadapter=org.eclipse.emf.teneo.hibernate.test.stores.adapters.HibernatePgsqlDBAdapter
+
+mssql.dburl=jdbc:jtds:sqlserver://192.168.32.130:1435/
+mssql.dbuser=sa
+mssql.dbpassword=s1men
+mssql.dbdriver=net.sourceforge.jtds.jdbc.Driver
+mssql.dbadapter=org.eclipse.emf.teneo.hibernate.test.stores.adapters.HibernateMssqlDBAdapter
+
+mcssql.dburl=jdbc:jtds:sqlserver://192.168.32.130:1435/
+mcssql.dbuser=sa
+mcssql.dbpassword=s1men
+mcssql.dbdriver=net.sourceforge.jtds.jdbc.Driver
+mcssql.dbadapter=org.eclipse.emf.teneo.hibernate.test.stores.adapters.HibernateMssqlDBAdapter
+
+#mcssql.dburl=jdbc:microsoft:sqlserver://192.168.32.130:1435
+#mcssql.dbuser=sa
+#mcssql.dbpassword=s1men
+#mcssql.dbdriver=com.microsoft.jdbc.sqlserver.SQLServerDriver
+#mcssql.dbadapter=org.eclipse.emf.teneo.hibernate.test.stores.adapters.HibernateMcssqlDBAdapter
+
+# derby and hsqldb are to be tested further because of db specifics
+hsqldb.dburl=jdbc:hsqldb:file:/temp/run/testdb
+hsqldb.dbattachdatabase=true
+hsqldb.dbuser=sa
+hsqldb.dbpassword=
+hsqldb.dbdriver=org.hsqldb.jdbcDriver
+hsqldb.dbadapter=org.eclipse.emf.teneo.hibernate.test.stores.adapters.HibernateHsqlDBAdapter
+
+#derby.dburl=jdbc:derby://localhost:1527/
+#derby.dbattachdatabase=true
+#derby.dbuser=
+#derby.dbpassword=
+#derby.dbdriver=org.apache.derby.jdbc.ClientDriver
+#derby.dbadapter=
diff --git a/tests/org.eclipse.emf.teneo.hibernate.test/src/org/eclipse/emf/teneo/hibernate/test/AllTests.java b/tests/org.eclipse.emf.teneo.hibernate.test/src/org/eclipse/emf/teneo/hibernate/test/AllTests.java
new file mode 100644
index 000000000..d684911fe
--- /dev/null
+++ b/tests/org.eclipse.emf.teneo.hibernate.test/src/org/eclipse/emf/teneo/hibernate/test/AllTests.java
@@ -0,0 +1,43 @@
+/*
+ * Copyright 2004-2006, Elver.org (http://www.elver.org).
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.eclipse.emf.teneo.hibernate.test;
+
+import junit.framework.Test;
+import junit.framework.TestSuite;
+
+/**
+ * Runs all hibernate tests.
+ *
+ * @author <a href="mailto:mtaal@elver.org">Martin Taal</a>
+ * @version $Revision: 1.1 $
+ */
+public class AllTests {
+
+ public static Test suite() {
+ TestSuite suite = new TestSuite("All tests for hibernate");
+ suite.addTest(org.eclipse.emf.teneo.hibernate.test.emf.annotations.AllTests.suite());
+ suite.addTest(org.eclipse.emf.teneo.hibernate.test.emf.detach.AllTests.suite());
+ suite.addTest(org.eclipse.emf.teneo.hibernate.test.emf.elist.AllTests.suite());
+ suite.addTest(org.eclipse.emf.teneo.hibernate.test.emf.relation.AllTests.suite());
+ suite.addTest(org.eclipse.emf.teneo.hibernate.test.emf.sample.AllTests.suite());
+ suite.addTest(org.eclipse.emf.teneo.hibernate.test.emf.schemaconstructs.AllTests.suite());
+ suite.addTest(org.eclipse.emf.teneo.hibernate.test.issues.AllTests.suite());
+ suite.addTest(org.eclipse.emf.teneo.hibernate.test.test.AllTests.suite());
+
+ return suite;
+ }
+
+}
diff --git a/tests/org.eclipse.emf.teneo.hibernate.test/src/org/eclipse/emf/teneo/hibernate/test/HibernateTestbed.java b/tests/org.eclipse.emf.teneo.hibernate.test/src/org/eclipse/emf/teneo/hibernate/test/HibernateTestbed.java
new file mode 100644
index 000000000..7752193ad
--- /dev/null
+++ b/tests/org.eclipse.emf.teneo.hibernate.test/src/org/eclipse/emf/teneo/hibernate/test/HibernateTestbed.java
@@ -0,0 +1,125 @@
+/*
+ * Copyright 2004-2006, Elver.org (http://www.elver.org).
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.eclipse.emf.teneo.hibernate.test;
+
+import java.io.File;
+import java.io.FileWriter;
+import java.io.IOException;
+import java.util.Properties;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.eclipse.emf.teneo.PersistenceOptions;
+import org.eclipse.emf.teneo.hibernate.HbConstants;
+import org.eclipse.emf.teneo.hibernate.HbHelper;
+import org.eclipse.emf.teneo.hibernate.mapper.MappingException;
+import org.eclipse.emf.teneo.hibernate.test.stores.HibernateTestStoreFactory;
+import org.eclipse.emf.teneo.test.AbstractTest;
+import org.eclipse.emf.teneo.test.StoreTestException;
+import org.eclipse.emf.teneo.test.conf.TestConfiguration;
+import org.eclipse.emf.teneo.test.conf.Testbed;
+import org.eclipse.emf.teneo.test.stores.TestStore;
+
+/**
+ * Is the testbed which models the base in which a testrun is run.
+ *
+ * @author <a href="mailto:mtaal@elver.org">Martin Taal</a>
+ * @version $Revision: 1.1 $
+ */
+public class HibernateTestbed extends Testbed {
+
+ /** The logger */
+ private static Log log = LogFactory.getLog(HibernateTestbed.class);
+
+ /** If we get here then this should be the testbed! */
+ static {
+ Testbed.setTestBed(new HibernateTestbed());
+ }
+
+ /** Delegates to the test bed */
+ public static Testbed instance() {
+ return Testbed.instance();
+ }
+
+ /**
+ * The directory in which the mapping files are generated TODO make insesitive to user.dir
+ */
+ private static String RUN_BASE_DIR = System.getProperty("user.dir") + File.separatorChar + "run";
+
+ /** The factory which creates test stores */
+ private HibernateTestStoreFactory storeFactory;
+
+ /** Constructor */
+ private HibernateTestbed() {
+ storeFactory = new HibernateTestStoreFactory();
+ }
+
+ /**
+ * Request a store for the given configuration.
+ */
+ public TestStore createStore(AbstractTest testCase) {
+ try {
+
+ // get and write the mapping xml for debugging purposes.
+ // this is actually double as the storeFactory.get does the same thing
+ // but okay
+ writeMappingToFile(testCase);
+
+ TestStore store = storeFactory.get(getDbName(testCase, getActiveConfiguration()), testCase.getEPackages(), null,
+ getActiveConfiguration(), testCase.getExtraConfigurationProperties());
+
+ // setup store
+ store.setUp();
+
+ return store;
+ } catch (IOException e) {
+ throw new StoreTestException("Exception while writing hbm file " + e.getMessage(), e);
+ } catch (MappingException m) {
+ throw new StoreTestException("Exception while creating mapping file: " + m.getMessage(), m);
+ }
+ }
+
+ /** Creates the mapping xml and writes it to a mapping file */
+ private void writeMappingToFile(AbstractTest testCase) throws MappingException, IOException {
+ final Properties props = testCase.getExtraConfigurationProperties();
+ props.put(PersistenceOptions.INHERITANCE_MAPPING, getActiveConfiguration().getMappingStrategy().getName());
+ final Properties properties = new Properties();
+ properties.putAll(props);
+ final String mappingXML = HbHelper.INSTANCE.generateMapping(testCase.getEPackages(), properties);
+ writeMappingToFile(getHBMFile(testCase, getActiveConfiguration()), mappingXML);
+ }
+
+ /** Write the mapping file for debugging purposes */
+ private void writeMappingToFile(File mappingFile, String mappingXML) throws IOException {
+ if (mappingFile.exists()) mappingFile.delete();
+ mappingFile.createNewFile();
+ final FileWriter fileWriter = new FileWriter(mappingFile);
+ fileWriter.write(mappingXML);
+ fileWriter.close();
+ }
+
+ /** Returns the file to which the mapping file is written */
+ protected File getHBMFile(AbstractTest testCase, TestConfiguration cfg) {
+ return new File(getRunTestDir(testCase, cfg), HbConstants.HBM_FILE_NAME);
+ }
+
+ /** Return the directory in which the mapping file is stored */
+ protected File getRunTestDir(AbstractTest testCase, TestConfiguration cfg) {
+ File dir = new File(new File(RUN_BASE_DIR, testCase.getName()), cfg.getName());
+ dir.mkdirs();
+ return dir;
+ }
+}
diff --git a/tests/org.eclipse.emf.teneo.hibernate.test/src/org/eclipse/emf/teneo/hibernate/test/emf/annotations/AllTests.java b/tests/org.eclipse.emf.teneo.hibernate.test/src/org/eclipse/emf/teneo/hibernate/test/emf/annotations/AllTests.java
new file mode 100644
index 000000000..9e9de7200
--- /dev/null
+++ b/tests/org.eclipse.emf.teneo.hibernate.test/src/org/eclipse/emf/teneo/hibernate/test/emf/annotations/AllTests.java
@@ -0,0 +1,97 @@
+/*
+ * Copyright 2005-2006, Elver.org (http://www.elver.org).
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.eclipse.emf.teneo.hibernate.test.emf.annotations;
+
+import junit.framework.Test;
+import junit.framework.TestSuite;
+
+import org.eclipse.emf.teneo.hibernate.test.HibernateTestbed;
+import org.eclipse.emf.teneo.test.conf.MultiCfgTestSuite;
+import org.eclipse.emf.teneo.test.emf.annotations.AssociationOverrideAction;
+import org.eclipse.emf.teneo.test.emf.annotations.AttributeOverridesAction;
+import org.eclipse.emf.teneo.test.emf.annotations.BasicAction;
+import org.eclipse.emf.teneo.test.emf.annotations.BookAction;
+import org.eclipse.emf.teneo.test.emf.annotations.CascadeNotallAction;
+import org.eclipse.emf.teneo.test.emf.annotations.CompositeIdAction;
+import org.eclipse.emf.teneo.test.emf.annotations.DuplicatesAction;
+import org.eclipse.emf.teneo.test.emf.annotations.EmbeddedAction;
+import org.eclipse.emf.teneo.test.emf.annotations.EmbeddedIdAction;
+import org.eclipse.emf.teneo.test.emf.annotations.IdAction;
+import org.eclipse.emf.teneo.test.emf.annotations.IdBagAction;
+import org.eclipse.emf.teneo.test.emf.annotations.InheritanceAnnotationAction;
+import org.eclipse.emf.teneo.test.emf.annotations.LazyLibraryAction;
+import org.eclipse.emf.teneo.test.emf.annotations.LobAction;
+import org.eclipse.emf.teneo.test.emf.annotations.ManyToManyAction;
+import org.eclipse.emf.teneo.test.emf.annotations.MappedSuperClassAction;
+import org.eclipse.emf.teneo.test.emf.annotations.PKeyJoinAction;
+import org.eclipse.emf.teneo.test.emf.annotations.SecondarytableHibernateAction;
+import org.eclipse.emf.teneo.test.emf.annotations.SetAction;
+import org.eclipse.emf.teneo.test.emf.annotations.SetNMAction;
+import org.eclipse.emf.teneo.test.emf.annotations.SetResourceAction;
+import org.eclipse.emf.teneo.test.emf.annotations.ToOneAction;
+import org.eclipse.emf.teneo.test.emf.annotations.TransientAction;
+import org.eclipse.emf.teneo.test.emf.annotations.UniqueConstraintsAction;
+
+/**
+ * All tests
+ *
+ * @author <a href="mailto:mtaal@elver.org">Martin Taal</a>
+ * @version $Revision: 1.1 $
+ */
+public class AllTests {
+
+ public static Test suite() {
+ TestSuite suite = new MultiCfgTestSuite("Test for org.eclipse.emf.teneo.hibernate.test.emf.annotations",
+ HibernateTestbed.instance().getConfigurations());
+
+ suite.addTestSuite(ToOneAction.class);
+ suite.addTestSuite(SecondarytableHibernateAction.class);
+ suite.addTestSuite(InheritanceAnnotationAction.class);
+ suite.addTestSuite(JoinColumnsTest.class);
+ suite.addTestSuite(BookAction.class);
+
+ suite.addTestSuite(IdAction.class);
+ suite.addTestSuite(MappedSuperClassAction.class);
+ suite.addTestSuite(AssociationOverrideAction.class);
+ suite.addTestSuite(IdBagAction.class);
+ suite.addTestSuite(UserTypeAction.class);
+
+
+ suite.addTestSuite(ManyToManyAction.class);
+
+ suite.addTestSuite(SetAction.class);
+ suite.addTestSuite(TransientAction.class);
+ suite.addTestSuite(BasicAction.class);
+
+ suite.addTestSuite(CascadeNotallAction.class);
+ suite.addTestSuite(UniqueConstraintsAction.class);
+ suite.addTestSuite(CompositeIdAction.class);
+ suite.addTestSuite(PKeyJoinAction.class);
+
+ suite.addTestSuite(EmbeddedAction.class);
+
+ suite.addTestSuite(SetResourceAction.class);
+ suite.addTestSuite(SetNMAction.class);
+ suite.addTestSuite(LazyLibraryAction.class);
+ suite.addTestSuite(DuplicatesAction.class);
+ suite.addTestSuite(AttributeOverridesAction.class);
+ suite.addTestSuite(LobAction.class);
+ suite.addTestSuite(EmbeddedIdAction.class);
+ return suite;
+
+ }
+
+}
diff --git a/tests/org.eclipse.emf.teneo.hibernate.test/src/org/eclipse/emf/teneo/hibernate/test/emf/annotations/JoinColumnsTest.java b/tests/org.eclipse.emf.teneo.hibernate.test/src/org/eclipse/emf/teneo/hibernate/test/emf/annotations/JoinColumnsTest.java
new file mode 100644
index 000000000..937f5dea8
--- /dev/null
+++ b/tests/org.eclipse.emf.teneo.hibernate.test/src/org/eclipse/emf/teneo/hibernate/test/emf/annotations/JoinColumnsTest.java
@@ -0,0 +1,74 @@
+/*
+ * Copyright 2005-2006, Elver.org (http://www.elver.org).
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.eclipse.emf.teneo.hibernate.test.emf.annotations;
+
+import java.io.ByteArrayOutputStream;
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileNotFoundException;
+import java.io.FileOutputStream;
+import java.io.OutputStream;
+import java.sql.Connection;
+import java.sql.ResultSet;
+import java.sql.SQLException;
+import java.sql.Statement;
+
+import org.eclipse.emf.teneo.annotations.pannotation.InheritanceType;
+import org.eclipse.emf.teneo.hibernate.HbConstants;
+import org.eclipse.emf.teneo.hibernate.HbDataStore;
+import org.eclipse.emf.teneo.hibernate.test.stores.HibernateTestStore;
+import org.eclipse.emf.teneo.test.AbstractActionTest;
+import org.eclipse.emf.teneo.test.StoreTestException;
+import org.eclipse.emf.teneo.test.emf.annotations.JoinColumnsAction;
+import org.eclipse.emf.teneo.test.emf.sample.AccountingAction;
+import org.eclipse.emf.teneo.test.emf.sample.PlayImExportAction;
+import org.eclipse.emf.teneo.test.stores.TestStore;
+
+/**
+ * Tests import export
+ *
+ * @author <a href="mailto:mtaal@elver.org">Martin Taal</a>
+ * @version $Revision: 1.1 $
+ */
+public class JoinColumnsTest extends AbstractActionTest {
+
+ private static JoinColumnsAction testAction = new JoinColumnsAction() {
+
+ /** Checks the version column */
+ protected void checkVersion(TestStore store) {
+ Connection conn = null;
+ Statement stmt = null;
+ try {
+ try {
+ conn = store.getConnection();
+ stmt = conn.createStatement();
+ // check version column name
+ ResultSet rs = stmt.executeQuery("select myversion from person");
+ assertTrue(rs.next());
+ } finally {
+ if (stmt != null) stmt.close();
+ if (conn != null) conn.close();
+ }
+ } catch (SQLException e) {
+ throw new StoreTestException("Sql exception when checking db schema", e);
+ }
+ }
+ };
+
+ public JoinColumnsTest() {
+ super(testAction);
+ }
+}
diff --git a/tests/org.eclipse.emf.teneo.hibernate.test/src/org/eclipse/emf/teneo/hibernate/test/emf/annotations/UserTypeAction.java b/tests/org.eclipse.emf.teneo.hibernate.test/src/org/eclipse/emf/teneo/hibernate/test/emf/annotations/UserTypeAction.java
new file mode 100644
index 000000000..4af3dd51c
--- /dev/null
+++ b/tests/org.eclipse.emf.teneo.hibernate.test/src/org/eclipse/emf/teneo/hibernate/test/emf/annotations/UserTypeAction.java
@@ -0,0 +1,77 @@
+package org.eclipse.emf.teneo.hibernate.test.emf.annotations;
+
+import java.sql.Connection;
+import java.sql.ResultSet;
+import java.sql.SQLException;
+import java.sql.Statement;
+import java.util.List;
+
+import org.eclipse.emf.teneo.samples.emf.hibernate.usertype.Name;
+import org.eclipse.emf.teneo.samples.emf.hibernate.usertype.Person;
+import org.eclipse.emf.teneo.samples.emf.hibernate.usertype.UsertypeFactory;
+import org.eclipse.emf.teneo.samples.emf.hibernate.usertype.UsertypePackage;
+import org.eclipse.emf.teneo.test.AbstractTestAction;
+import org.eclipse.emf.teneo.test.stores.TestStore;
+
+public class UserTypeAction extends AbstractTestAction {
+
+ private static final Name NAME = new Name("Pietje", "Puk");
+
+ private static final String VERIFICATION_QUERY = "SELECT first_name, last_name FROM person";
+
+ public UserTypeAction() {
+ super(UsertypePackage.eINSTANCE);
+ }
+
+ public void doAction(TestStore store) {
+ storePerson(store);
+ testPerson(store);
+ testDatabase(store);
+ }
+
+ private void storePerson(TestStore store) {
+ store.beginTransaction();
+ Person person = UsertypeFactory.eINSTANCE.createPerson();
+ person.setName(NAME);
+ store.store(person);
+ store.commitTransaction();
+ }
+
+ private void testPerson(TestStore store) {
+ store.beginTransaction();
+ List results = store.query("FROM Person");
+ assertEquals(1, results.size());
+ Person person = (Person) results.get(0);
+ assertEquals(NAME, person.getName());
+ store.commitTransaction();
+ }
+
+ private void testDatabase(TestStore store) {
+ final Connection connection = store.getConnection();
+ Statement statement = null;
+ ResultSet resultSet = null;
+ try {
+ statement = connection.createStatement();
+ resultSet = statement.executeQuery(VERIFICATION_QUERY);
+ assertTrue(resultSet.next());
+ assertEquals(NAME.getFirst(), resultSet.getString(1));
+ assertEquals(NAME.getLast(), resultSet.getString(2));
+ } catch (SQLException e) {
+ assertFalse(e.getMessage(), true);
+ } finally {
+ try {
+ if (resultSet != null) {
+ resultSet.close();
+ }
+ } catch (SQLException e) {
+ }
+ try {
+ if (statement != null) {
+ statement.close();
+ }
+ } catch (SQLException e) {
+ }
+ }
+ }
+
+}
diff --git a/tests/org.eclipse.emf.teneo.hibernate.test/src/org/eclipse/emf/teneo/hibernate/test/emf/detach/AllTests.java b/tests/org.eclipse.emf.teneo.hibernate.test/src/org/eclipse/emf/teneo/hibernate/test/emf/detach/AllTests.java
new file mode 100644
index 000000000..fa9c6d842
--- /dev/null
+++ b/tests/org.eclipse.emf.teneo.hibernate.test/src/org/eclipse/emf/teneo/hibernate/test/emf/detach/AllTests.java
@@ -0,0 +1,42 @@
+/*
+ * Copyright 2005-2006, Elver.org (http://www.elver.org).
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.eclipse.emf.teneo.hibernate.test.emf.detach;
+
+import junit.framework.Test;
+import junit.framework.TestSuite;
+
+import org.eclipse.emf.teneo.hibernate.test.HibernateTestbed;
+import org.eclipse.emf.teneo.test.conf.MultiCfgTestSuite;
+import org.eclipse.emf.teneo.test.emf.detach.DetachEListAction;
+
+/**
+ * Test
+ *
+ * @author <a href="mailto:mtaal@elver.org">Martin Taal</a>
+ * @version $Revision: 1.1 $
+ */
+public class AllTests {
+
+ public static Test suite() {
+ TestSuite suite = new MultiCfgTestSuite("Test for org.eclipse.emf.teneo.hibernate.test.emf.detach", HibernateTestbed.instance()
+ .getConfigurations());
+
+ suite.addTestSuite(DetachEListAction.class);
+ suite.addTestSuite(DetachTest.class);
+ suite.addTestSuite(DetachFeatureMapTest.class);
+ return suite;
+ }
+}
diff --git a/tests/org.eclipse.emf.teneo.hibernate.test/src/org/eclipse/emf/teneo/hibernate/test/emf/detach/DetachFeatureMapTest.java b/tests/org.eclipse.emf.teneo.hibernate.test/src/org/eclipse/emf/teneo/hibernate/test/emf/detach/DetachFeatureMapTest.java
new file mode 100644
index 000000000..129054bea
--- /dev/null
+++ b/tests/org.eclipse.emf.teneo.hibernate.test/src/org/eclipse/emf/teneo/hibernate/test/emf/detach/DetachFeatureMapTest.java
@@ -0,0 +1,41 @@
+/*
+ * Copyright 2005-2006, Elver.org (http://www.elver.org).
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.eclipse.emf.teneo.hibernate.test.emf.detach;
+
+import org.eclipse.emf.teneo.resource.StoreResource;
+import org.eclipse.emf.teneo.test.AbstractActionTest;
+import org.eclipse.emf.teneo.test.emf.detach.DetachFeatureMapAction;
+import org.eclipse.emf.teneo.test.stores.TestStore;
+
+/**
+ * Is a test case to test detach functionality for featuremap with different kinds of methods on the featuremap (move, set, etc).
+ *
+ * @version $Revision: 1.1 $
+ */
+public class DetachFeatureMapTest extends AbstractActionTest {
+
+ /** Creates a hibernate specific version of the action */
+ private static DetachFeatureMapAction testAction = new DetachFeatureMapAction() {
+ /** Returns the resource uri, jdo is default (for now) */
+ public String getResourceUri(TestStore store) {
+ return "hibernate://?" + StoreResource.DS_NAME_PARAM + "=" + store.getDatabaseAdapter().getDbName();
+ }
+ };
+
+ public DetachFeatureMapTest() {
+ super(testAction);
+ }
+} \ No newline at end of file
diff --git a/tests/org.eclipse.emf.teneo.hibernate.test/src/org/eclipse/emf/teneo/hibernate/test/emf/detach/DetachTest.java b/tests/org.eclipse.emf.teneo.hibernate.test/src/org/eclipse/emf/teneo/hibernate/test/emf/detach/DetachTest.java
new file mode 100644
index 000000000..243dd643b
--- /dev/null
+++ b/tests/org.eclipse.emf.teneo.hibernate.test/src/org/eclipse/emf/teneo/hibernate/test/emf/detach/DetachTest.java
@@ -0,0 +1,41 @@
+/*
+ * Copyright 2005-2006, Elver.org (http://www.elver.org).
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.eclipse.emf.teneo.hibernate.test.emf.detach;
+
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.teneo.test.AbstractActionTest;
+import org.eclipse.emf.teneo.test.emf.detach.DetachAction;
+
+/**
+ * Test
+ *
+ * @author <a href="mailto:mtaal@elver.org">Martin Taal</a>
+ * @version $Revision: 1.1 $
+ */
+public class DetachTest extends AbstractActionTest {
+
+ private static DetachAction testAction = new DetachAction() {
+
+ protected void checkDetached(EObject eObject) {
+ // TODO Auto-generated method stub
+ }
+ };
+
+ public DetachTest() {
+ super(testAction);
+ }
+
+}
diff --git a/tests/org.eclipse.emf.teneo.hibernate.test/src/org/eclipse/emf/teneo/hibernate/test/emf/elist/AllTests.java b/tests/org.eclipse.emf.teneo.hibernate.test/src/org/eclipse/emf/teneo/hibernate/test/emf/elist/AllTests.java
new file mode 100644
index 000000000..abc11b9ae
--- /dev/null
+++ b/tests/org.eclipse.emf.teneo.hibernate.test/src/org/eclipse/emf/teneo/hibernate/test/emf/elist/AllTests.java
@@ -0,0 +1,45 @@
+/*
+ * Copyright 2005-2006, Elver.org (http://www.elver.org).
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.eclipse.emf.teneo.hibernate.test.emf.elist;
+
+import junit.framework.Test;
+import junit.framework.TestSuite;
+
+import org.eclipse.emf.teneo.hibernate.test.HibernateTestbed;
+import org.eclipse.emf.teneo.test.conf.MultiCfgTestSuite;
+import org.eclipse.emf.teneo.test.emf.elist.FeatureMapAction;
+
+/**
+ * All tests
+ *
+ * @author <a href="mailto:mtaal@elver.org">Martin Taal</a>
+ * @version $Revision: 1.1 $
+ */
+public class AllTests {
+
+ public static Test suite() {
+ TestSuite suite = new MultiCfgTestSuite("Test for org.eclipse.emf.teneo.hibernate.test.emf.elist", HibernateTestbed.instance()
+ .getConfigurations());
+
+ suite.addTestSuite(FeatureMapAction.class);
+
+ // $JUnit-BEGIN$
+
+ // $JUnit-END$
+ return suite;
+ }
+
+}
diff --git a/tests/org.eclipse.emf.teneo.hibernate.test/src/org/eclipse/emf/teneo/hibernate/test/emf/relation/AllTests.java b/tests/org.eclipse.emf.teneo.hibernate.test/src/org/eclipse/emf/teneo/hibernate/test/emf/relation/AllTests.java
new file mode 100644
index 000000000..9ba302523
--- /dev/null
+++ b/tests/org.eclipse.emf.teneo.hibernate.test/src/org/eclipse/emf/teneo/hibernate/test/emf/relation/AllTests.java
@@ -0,0 +1,49 @@
+/*
+ * Copyright 2005-2006, Elver.org (http://www.elver.org).
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.eclipse.emf.teneo.hibernate.test.emf.relation;
+
+import junit.framework.Test;
+import junit.framework.TestSuite;
+
+import org.eclipse.emf.teneo.hibernate.test.HibernateTestbed;
+import org.eclipse.emf.teneo.test.conf.MultiCfgTestSuite;
+import org.eclipse.emf.teneo.test.emf.relation.Relation1to1Action;
+import org.eclipse.emf.teneo.test.emf.relation.Relation1tonAction;
+import org.eclipse.emf.teneo.test.emf.relation.RelationntomAction;
+
+/**
+ * Test
+ *
+ * @author <a href="mailto:mtaal@elver.org">Martin Taal</a>
+ * @version $Revision: 1.1 $
+ */
+public class AllTests {
+
+ public static Test suite() {
+ TestSuite suite = new MultiCfgTestSuite("Test for org.eclipse.emf.teneo.hibernate.test.emf.relation", HibernateTestbed.instance()
+ .getConfigurations());
+
+ suite.addTestSuite(Relation1to1Action.class);
+ suite.addTestSuite(Relation1tonAction.class);
+ suite.addTestSuite(RelationntomAction.class);
+
+ // $JUnit-BEGIN$
+
+ // $JUnit-END$
+ return suite;
+ }
+
+}
diff --git a/tests/org.eclipse.emf.teneo.hibernate.test/src/org/eclipse/emf/teneo/hibernate/test/emf/sample/AccountingTest.java b/tests/org.eclipse.emf.teneo.hibernate.test/src/org/eclipse/emf/teneo/hibernate/test/emf/sample/AccountingTest.java
new file mode 100644
index 000000000..fc6e38c20
--- /dev/null
+++ b/tests/org.eclipse.emf.teneo.hibernate.test/src/org/eclipse/emf/teneo/hibernate/test/emf/sample/AccountingTest.java
@@ -0,0 +1,64 @@
+/*
+ * Copyright 2005-2006, Elver.org (http://www.elver.org).
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.eclipse.emf.teneo.hibernate.test.emf.sample;
+
+import java.io.ByteArrayOutputStream;
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileNotFoundException;
+import java.io.FileOutputStream;
+import java.io.OutputStream;
+
+import org.eclipse.emf.teneo.hibernate.HbConstants;
+import org.eclipse.emf.teneo.hibernate.HbDataStore;
+import org.eclipse.emf.teneo.hibernate.test.stores.HibernateTestStore;
+import org.eclipse.emf.teneo.test.AbstractActionTest;
+import org.eclipse.emf.teneo.test.StoreTestException;
+import org.eclipse.emf.teneo.test.emf.sample.AccountingAction;
+import org.eclipse.emf.teneo.test.emf.sample.PlayImExportAction;
+import org.eclipse.emf.teneo.test.stores.TestStore;
+
+/**
+ * Tests import export
+ *
+ * @author <a href="mailto:mtaal@elver.org">Martin Taal</a>
+ * @version $Revision: 1.1 $
+ */
+public class AccountingTest extends AbstractActionTest {
+
+ private static AccountingAction testAction = new AccountingAction() {
+
+ /** Import/export, from and to */
+ protected void imTestExport(File fromFile, TestStore store) {
+ try {
+ // import
+ HibernateTestStore hbTestStore = (HibernateTestStore) store;
+ HbDataStore ds = hbTestStore.getEmfDataStore();
+
+ ds.importDataStore(new FileInputStream(fromFile), HbConstants.EXCHANGE_FORMAT_XMI);
+
+ // export
+ ds.exportDataStore(new ByteArrayOutputStream(), HbConstants.EXCHANGE_FORMAT_XML, null);
+ } catch (FileNotFoundException f) {
+ throw new StoreTestException("File not found", f);
+ }
+ }
+ };
+
+ public AccountingTest() {
+ super(testAction);
+ }
+}
diff --git a/tests/org.eclipse.emf.teneo.hibernate.test/src/org/eclipse/emf/teneo/hibernate/test/emf/sample/AllTests.java b/tests/org.eclipse.emf.teneo.hibernate.test/src/org/eclipse/emf/teneo/hibernate/test/emf/sample/AllTests.java
new file mode 100644
index 000000000..84ff9f596
--- /dev/null
+++ b/tests/org.eclipse.emf.teneo.hibernate.test/src/org/eclipse/emf/teneo/hibernate/test/emf/sample/AllTests.java
@@ -0,0 +1,78 @@
+/*
+ * Copyright 2005-2006, Elver.org (http://www.elver.org).
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.eclipse.emf.teneo.hibernate.test.emf.sample;
+
+import junit.framework.Test;
+import junit.framework.TestSuite;
+
+import org.eclipse.emf.teneo.hibernate.test.HibernateTestbed;
+import org.eclipse.emf.teneo.test.conf.MultiCfgTestSuite;
+import org.eclipse.emf.teneo.test.emf.sample.CatalogResourceAction;
+import org.eclipse.emf.teneo.test.emf.sample.DynamicAction;
+import org.eclipse.emf.teneo.test.emf.sample.ForumAction;
+import org.eclipse.emf.teneo.test.emf.sample.InventoryAction;
+import org.eclipse.emf.teneo.test.emf.sample.LibraryAction;
+import org.eclipse.emf.teneo.test.emf.sample.LibraryColLengthAction;
+import org.eclipse.emf.teneo.test.emf.sample.LibraryGlobalEagerAction;
+import org.eclipse.emf.teneo.test.emf.sample.LibraryNonResolvingAction;
+import org.eclipse.emf.teneo.test.emf.sample.LibraryQualifyActionHB;
+import org.eclipse.emf.teneo.test.emf.sample.LibraryResourceAction;
+import org.eclipse.emf.teneo.test.emf.sample.LibraryResourceCutPasteAction;
+import org.eclipse.emf.teneo.test.emf.sample.PlayAction;
+import org.eclipse.emf.teneo.test.emf.sample.PrimerPOAction;
+import org.eclipse.emf.teneo.test.emf.sample.ProductAction;
+import org.eclipse.emf.teneo.test.emf.sample.SunBooksAction;
+import org.eclipse.emf.teneo.test.emf.sample.WorkFlowAction;
+
+/**
+ * All sample tests
+ *
+ * @author <a href="mailto:mtaal@elver.org">Martin Taal</a>
+ * @version $Revision: 1.1 $
+ */
+public class AllTests {
+
+ public static Test suite() {
+ TestSuite suite = new MultiCfgTestSuite("Test for org.eclipse.emf.teneo.hibernate.test.emf.sample", HibernateTestbed.instance()
+ .getConfigurations());
+ suite.addTestSuite(LibraryNonResolvingAction.class);
+ suite.addTestSuite(LibraryAction.class);
+
+ suite.addTestSuite(DynamicAction.class);
+ suite.addTestSuite(AccountingTest.class);
+ suite.addTestSuite(SunBooksAction.class);
+ suite.addTestSuite(LibraryTest.class);
+ suite.addTestSuite(SchoolLibraryTest.class);
+ //suite.addTestSuite(WoWAction.class);
+ suite.addTestSuite(CatalogTest.class);
+ suite.addTestSuite(InventoryAction.class);
+ suite.addTestSuite(LibraryColLengthAction.class);
+ suite.addTestSuite(LibraryResourceCutPasteAction.class);
+ suite.addTestSuite(LibraryValidateResourceTest.class);
+ suite.addTestSuite(CatalogResourceAction.class);
+
+ suite.addTestSuite(LibraryQualifyActionHB.class);
+ suite.addTestSuite(LibraryGlobalEagerAction.class);
+ suite.addTestSuite(LibraryResourceAction.class);
+ suite.addTestSuite(PlayAction.class);
+ suite.addTestSuite(ExtendedPO2Test.class);
+ suite.addTestSuite(PrimerPOAction.class);
+ suite.addTestSuite(ProductAction.class);
+ suite.addTestSuite(WorkFlowAction.class);
+ suite.addTestSuite(ForumAction.class);
+ return suite;
+ }
+}
diff --git a/tests/org.eclipse.emf.teneo.hibernate.test/src/org/eclipse/emf/teneo/hibernate/test/emf/sample/CatalogTest.java b/tests/org.eclipse.emf.teneo.hibernate.test/src/org/eclipse/emf/teneo/hibernate/test/emf/sample/CatalogTest.java
new file mode 100644
index 000000000..163235f5a
--- /dev/null
+++ b/tests/org.eclipse.emf.teneo.hibernate.test/src/org/eclipse/emf/teneo/hibernate/test/emf/sample/CatalogTest.java
@@ -0,0 +1,40 @@
+/*
+ * Copyright 2005-2006, Elver.org (http://www.elver.org).
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.eclipse.emf.teneo.hibernate.test.emf.sample;
+
+import org.eclipse.emf.teneo.test.AbstractActionTest;
+import org.eclipse.emf.teneo.test.emf.sample.CatalogAction;
+
+/**
+ * Tests the library example of emf/xsd.
+ *
+ * @author <a href="mailto:mtaal@elver.org">Martin Taal</a>
+ * @version $Revision: 1.1 $
+ */
+public class CatalogTest extends AbstractActionTest {
+
+ private static CatalogAction testAction = new CatalogAction() {
+
+ protected String getQueryText() {
+ return "SELECT product FROM ProductType product," + " StringType rem"
+ + " WHERE rem in elements(product.remark) and rem.value = 'remarka'";
+ }
+ };
+
+ public CatalogTest() {
+ super(testAction);
+ }
+}
diff --git a/tests/org.eclipse.emf.teneo.hibernate.test/src/org/eclipse/emf/teneo/hibernate/test/emf/sample/ExtendedPO2Test.java b/tests/org.eclipse.emf.teneo.hibernate.test/src/org/eclipse/emf/teneo/hibernate/test/emf/sample/ExtendedPO2Test.java
new file mode 100644
index 000000000..431783921
--- /dev/null
+++ b/tests/org.eclipse.emf.teneo.hibernate.test/src/org/eclipse/emf/teneo/hibernate/test/emf/sample/ExtendedPO2Test.java
@@ -0,0 +1,40 @@
+/*
+ * Copyright 2005-2006, Elver.org (http://www.elver.org).
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.eclipse.emf.teneo.hibernate.test.emf.sample;
+
+import org.eclipse.emf.teneo.test.AbstractActionTest;
+import org.eclipse.emf.teneo.test.emf.sample.ExtendedPO2Action;
+import org.eclipse.emf.teneo.test.stores.TestStore;
+
+/**
+ * Tests the library example of emf/xsd.
+ *
+ * @author <a href="mailto:mtaal@elver.org">Martin Taal</a>
+ * @version $Revision: 1.1 $
+ */
+public class ExtendedPO2Test extends AbstractActionTest {
+
+ private static ExtendedPO2Action testAction = new ExtendedPO2Action() {
+
+ protected void checkContainerForSeparatelyReadItem(TestStore store) {
+ // TODO Auto-generated method stub
+ }
+ };
+
+ public ExtendedPO2Test() {
+ super(testAction);
+ }
+}
diff --git a/tests/org.eclipse.emf.teneo.hibernate.test/src/org/eclipse/emf/teneo/hibernate/test/emf/sample/LibraryTest.java b/tests/org.eclipse.emf.teneo.hibernate.test/src/org/eclipse/emf/teneo/hibernate/test/emf/sample/LibraryTest.java
new file mode 100644
index 000000000..3ffce447f
--- /dev/null
+++ b/tests/org.eclipse.emf.teneo.hibernate.test/src/org/eclipse/emf/teneo/hibernate/test/emf/sample/LibraryTest.java
@@ -0,0 +1,51 @@
+/*
+ * Copyright 2005-2006, Elver.org (http://www.elver.org).
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.eclipse.emf.teneo.hibernate.test.emf.sample;
+
+import org.eclipse.emf.teneo.samples.emf.sample.library.Library;
+import org.eclipse.emf.teneo.samples.emf.sample.library.Writer;
+import org.eclipse.emf.teneo.mapping.elist.PersistableEList;
+import org.eclipse.emf.teneo.test.AbstractActionTest;
+import org.eclipse.emf.teneo.test.emf.sample.LibraryAction;
+import org.eclipse.emf.teneo.test.stores.TestStore;
+
+/**
+ * Tests the library example of emf/xsd.
+ *
+ * @author <a href="mailto:mtaal@elver.org">Martin Taal</a>
+ * @version $Revision: 1.1 $
+ */
+public class LibraryTest extends AbstractActionTest {
+
+ private static LibraryAction testAction = new LibraryAction() {
+ protected void checkContainerAfterLibraryRetrieve(TestStore store, Writer writ) {
+ };
+
+ protected void checkContainerAfterWriterRetrieve(TestStore store, Writer writ) {
+ assertTrue(writ.eContainer() != null);
+ assertTrue(writ.eContainer() instanceof Library);
+ };
+
+ protected boolean listValueOfCorrectType(Object value) {
+ return (value instanceof PersistableEList);
+ };
+
+ };
+
+ public LibraryTest() {
+ super(testAction);
+ }
+}
diff --git a/tests/org.eclipse.emf.teneo.hibernate.test/src/org/eclipse/emf/teneo/hibernate/test/emf/sample/LibraryValidateResourceTest.java b/tests/org.eclipse.emf.teneo.hibernate.test/src/org/eclipse/emf/teneo/hibernate/test/emf/sample/LibraryValidateResourceTest.java
new file mode 100644
index 000000000..5f010a604
--- /dev/null
+++ b/tests/org.eclipse.emf.teneo.hibernate.test/src/org/eclipse/emf/teneo/hibernate/test/emf/sample/LibraryValidateResourceTest.java
@@ -0,0 +1,57 @@
+/*
+ * Copyright 2005-2006, Elver.org (http://www.elver.org).
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.eclipse.emf.teneo.hibernate.test.emf.sample;
+
+import org.eclipse.emf.ecore.resource.Resource;
+import org.eclipse.emf.teneo.hibernate.resource.HibernateResource;
+import org.eclipse.emf.teneo.test.AbstractActionTest;
+import org.eclipse.emf.teneo.test.emf.sample.LibraryValidateResourceAction;
+import org.hibernate.Session;
+import org.hibernate.Transaction;
+
+/**
+ * Test
+ *
+ * @author <a href="mailto:mtaal@elver.org">Martin Taal</a>
+ * @version $Revision: 1.1 $
+ */
+public class LibraryValidateResourceTest extends AbstractActionTest {
+
+ private static LibraryValidateResourceAction testAction = new LibraryValidateResourceAction() {
+
+ /** Specific Hibernate flush test */
+ protected void testFlush(Resource res) {
+ if (res instanceof HibernateResource) {
+ HibernateResource hres = (HibernateResource) res;
+ Session session = hres.getSession();
+ Transaction tx = session.beginTransaction();
+
+ // this should not fail!
+ try {
+ tx.commit();
+ }
+ // there should be a finally block but this is only a test
+ catch (Exception e) {
+ fail("The transaction commit should not flush illegal objects to the database");
+ }
+ }
+ }
+ };
+
+ public LibraryValidateResourceTest() {
+ super(testAction);
+ }
+}
diff --git a/tests/org.eclipse.emf.teneo.hibernate.test/src/org/eclipse/emf/teneo/hibernate/test/emf/sample/PlayImExportTest.java b/tests/org.eclipse.emf.teneo.hibernate.test/src/org/eclipse/emf/teneo/hibernate/test/emf/sample/PlayImExportTest.java
new file mode 100644
index 000000000..233661395
--- /dev/null
+++ b/tests/org.eclipse.emf.teneo.hibernate.test/src/org/eclipse/emf/teneo/hibernate/test/emf/sample/PlayImExportTest.java
@@ -0,0 +1,60 @@
+/*
+ * Copyright 2005-2006, Elver.org (http://www.elver.org).
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.eclipse.emf.teneo.hibernate.test.emf.sample;
+
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileNotFoundException;
+import java.io.FileOutputStream;
+
+import org.eclipse.emf.teneo.hibernate.HbConstants;
+import org.eclipse.emf.teneo.hibernate.HbDataStore;
+import org.eclipse.emf.teneo.hibernate.test.stores.HibernateTestStore;
+import org.eclipse.emf.teneo.test.AbstractActionTest;
+import org.eclipse.emf.teneo.test.StoreTestException;
+import org.eclipse.emf.teneo.test.emf.sample.PlayImExportAction;
+import org.eclipse.emf.teneo.test.stores.TestStore;
+
+/**
+ * Tests import export
+ *
+ * @author <a href="mailto:mtaal@elver.org">Martin Taal</a>
+ * @version $Revision: 1.1 $
+ */
+public class PlayImExportTest extends AbstractActionTest {
+
+ private static PlayImExportAction testAction = new PlayImExportAction() {
+
+ /** Import/export, from and to */
+ protected void imExport(File fromFile, File toFile, TestStore store) {
+ try {
+ // import
+ HibernateTestStore hbTestStore = (HibernateTestStore) store;
+ HbDataStore ds = hbTestStore.getEmfDataStore();
+ ds.importDataStore(new FileInputStream(fromFile), HbConstants.EXCHANGE_FORMAT_XML);
+
+ // export
+ ds.exportDataStore(new FileOutputStream(toFile), HbConstants.EXCHANGE_FORMAT_XML, null);
+ } catch (FileNotFoundException f) {
+ throw new StoreTestException("File not found", f);
+ }
+ }
+ };
+
+ public PlayImExportTest() {
+ super(testAction);
+ }
+}
diff --git a/tests/org.eclipse.emf.teneo.hibernate.test/src/org/eclipse/emf/teneo/hibernate/test/emf/sample/SchoolLibraryTest.java b/tests/org.eclipse.emf.teneo.hibernate.test/src/org/eclipse/emf/teneo/hibernate/test/emf/sample/SchoolLibraryTest.java
new file mode 100644
index 000000000..bb83888ee
--- /dev/null
+++ b/tests/org.eclipse.emf.teneo.hibernate.test/src/org/eclipse/emf/teneo/hibernate/test/emf/sample/SchoolLibraryTest.java
@@ -0,0 +1,60 @@
+/*
+ * Copyright 2005-2006, Elver.org (http://www.elver.org).
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.eclipse.emf.teneo.hibernate.test.emf.sample;
+
+import org.eclipse.emf.ecore.InternalEObject;
+import org.eclipse.emf.teneo.test.AbstractActionTest;
+import org.eclipse.emf.teneo.test.emf.sample.SchoolLibraryAction;
+
+/**
+ * Tests the library example of emf/xsd.
+ *
+ * @author <a href="mailto:mtaal@elver.org">Martin Taal</a>
+ * @version $Revision: 1.1 $
+ */
+public class SchoolLibraryTest extends AbstractActionTest {
+
+ private static SchoolLibraryAction testAction = new SchoolLibraryAction() {
+ /** Returns one test query */
+ protected String getQuery1() {
+ return "query1=FROM Writer&query2=FROM Book";
+ }
+
+ /** Returns one test query */
+ protected String getQuery2() {
+ return "query1=FROM Writer";
+ }
+
+ /** Returns one test query */
+ protected String getQuery3() {
+ return "query1=FROM Writer&query2=FROM Book";
+ }
+
+ /** Returns one test query */
+ protected String getQuery4() {
+ return "query1=FROM Book";
+ }
+
+ /** Container present */
+ protected boolean hasContainer(InternalEObject obj) {
+ return obj.eContainer() != null;
+ }
+ };
+
+ public SchoolLibraryTest() {
+ super(testAction);
+ }
+} \ No newline at end of file
diff --git a/tests/org.eclipse.emf.teneo.hibernate.test/src/org/eclipse/emf/teneo/hibernate/test/emf/schemaconstructs/AllTests.java b/tests/org.eclipse.emf.teneo.hibernate.test/src/org/eclipse/emf/teneo/hibernate/test/emf/schemaconstructs/AllTests.java
new file mode 100644
index 000000000..38e73cb9b
--- /dev/null
+++ b/tests/org.eclipse.emf.teneo.hibernate.test/src/org/eclipse/emf/teneo/hibernate/test/emf/schemaconstructs/AllTests.java
@@ -0,0 +1,68 @@
+/*
+ * Copyright 2005-2006, Elver.org (http://www.elver.org).
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.eclipse.emf.teneo.hibernate.test.emf.schemaconstructs;
+
+import junit.framework.Test;
+import junit.framework.TestSuite;
+
+import org.eclipse.emf.teneo.hibernate.test.HibernateTestbed;
+import org.eclipse.emf.teneo.test.conf.MultiCfgTestSuite;
+import org.eclipse.emf.teneo.test.emf.schemaconstructs.EcoreAttrsAction;
+import org.eclipse.emf.teneo.test.emf.schemaconstructs.ExtensionAction;
+import org.eclipse.emf.teneo.test.emf.schemaconstructs.GroupAction;
+import org.eclipse.emf.teneo.test.emf.schemaconstructs.ListAction;
+import org.eclipse.emf.teneo.test.emf.schemaconstructs.MixedAction;
+import org.eclipse.emf.teneo.test.emf.schemaconstructs.NestedGroupAction;
+import org.eclipse.emf.teneo.test.emf.schemaconstructs.RestrictionAction;
+import org.eclipse.emf.teneo.test.emf.schemaconstructs.SimpleTypeAction;
+import org.eclipse.emf.teneo.test.emf.schemaconstructs.SimplefeaturemapAction;
+import org.eclipse.emf.teneo.test.emf.schemaconstructs.SubstitutionAction;
+import org.eclipse.emf.teneo.test.emf.schemaconstructs.SubstitutionzvonAction;
+
+/**
+ * All tests
+ *
+ * @author <a href="mailto:mtaal@elver.org">Martin Taal</a>
+ * @version $Revision: 1.1 $
+ */
+public class AllTests {
+
+ public static Test suite() {
+ TestSuite suite = new MultiCfgTestSuite("Test for org.eclipse.emf.teneo.hibernate.test.emf.schemaconstructs", HibernateTestbed
+ .instance().getConfigurations());
+ suite.addTestSuite(SimpleTypeAction.class);
+ suite.addTestSuite(ListAction.class);
+ suite.addTestSuite(EcoreAttrsAction.class);
+ suite.addTestSuite(MixedAction.class);
+ suite.addTestSuite(SimplefeaturemapAction.class);
+ suite.addTestSuite(RestrictionAction.class);
+ suite.addTestSuite(AttributesTest.class);
+ suite.addTestSuite(ExtensionAction.class);
+ suite.addTestSuite(GroupAction.class);
+ suite.addTestSuite(NestedGroupAction.class);
+ suite.addTestSuite(SubstitutionzvonAction.class);
+ suite.addTestSuite(SubstitutionAction.class);
+ /*
+ /*
+ * // The anytype test is not yet supported by Hibernate // suite.addTestSuite(AnyTypeAction.class); // Listunion types are not
+ * yet supported by hibernate //
+ suite.addTestSuite(ListUnionAction.class);
+ */
+ // $JUnit-END$
+ return suite;
+ }
+
+}
diff --git a/tests/org.eclipse.emf.teneo.hibernate.test/src/org/eclipse/emf/teneo/hibernate/test/emf/schemaconstructs/AttributesTest.java b/tests/org.eclipse.emf.teneo.hibernate.test/src/org/eclipse/emf/teneo/hibernate/test/emf/schemaconstructs/AttributesTest.java
new file mode 100644
index 000000000..b693a5a3a
--- /dev/null
+++ b/tests/org.eclipse.emf.teneo.hibernate.test/src/org/eclipse/emf/teneo/hibernate/test/emf/schemaconstructs/AttributesTest.java
@@ -0,0 +1,41 @@
+/*
+ * Copyright 2005-2006, Elver.org (http://www.elver.org).
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.eclipse.emf.teneo.hibernate.test.emf.schemaconstructs;
+
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.teneo.hibernate.mapping.identifier.IdentifierCacheHandler;
+import org.eclipse.emf.teneo.test.AbstractActionTest;
+import org.eclipse.emf.teneo.test.emf.schemaconstructs.AttributesAction;
+
+/**
+ * Tests the library example of emf/xsd.
+ *
+ * @author <a href="mailto:mtaal@elver.org">Martin Taal</a>
+ * @version $Revision: 1.1 $
+ */
+public class AttributesTest extends AbstractActionTest {
+
+ private static AttributesAction testAction = new AttributesAction() {
+
+ protected void checkIdIs(EObject o, String id) {
+ assertTrue(IdentifierCacheHandler.getID(o).toString().compareTo(id) == 0);
+ }
+ };
+
+ public AttributesTest() {
+ super(testAction);
+ }
+}
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
new file mode 100644
index 000000000..55de88e1f
--- /dev/null
+++ b/tests/org.eclipse.emf.teneo.hibernate.test/src/org/eclipse/emf/teneo/hibernate/test/issues/AllTests.java
@@ -0,0 +1,69 @@
+/*
+ * Copyright 2005-2006, Elver.org (http://www.elver.org).
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.eclipse.emf.teneo.hibernate.test.issues;
+
+import junit.framework.Test;
+import junit.framework.TestSuite;
+
+import org.eclipse.emf.teneo.hibernate.test.HibernateTestbed;
+import org.eclipse.emf.teneo.test.conf.MultiCfgTestSuite;
+import org.eclipse.emf.teneo.test.issues.AbstractReferenceAction;
+import org.eclipse.emf.teneo.test.issues.BagDuplicateAction;
+import org.eclipse.emf.teneo.test.issues.EnumTestAction;
+import org.eclipse.emf.teneo.test.issues.InheritanceAction;
+import org.eclipse.emf.teneo.test.issues.InterfaceTrueAction;
+import org.eclipse.emf.teneo.test.issues.ResourceAction;
+import org.eclipse.emf.teneo.test.issues.SimplenmAction;
+import org.eclipse.emf.teneo.test.issues.TopClassesAction;
+
+/**
+ * All tests
+ *
+ * @author <a href="mailto:mtaal@elver.org">Martin Taal</a>
+ * @version $Revision: 1.1 $
+ */
+public class AllTests {
+
+ public static Test suite() {
+ TestSuite suite = new MultiCfgTestSuite("Test for org.eclipse.emf.teneo.hibernate.test.issues", HibernateTestbed.instance()
+ .getConfigurations());
+
+ suite.addTestSuite(InheritanceAction.class);
+ suite.addTestSuite(ResourceAction.class);
+
+ suite.addTestSuite(BagDuplicateAction.class);
+ suite.addTestSuite(EnumTestAction.class);
+
+ suite.addTestSuite(AbstractReferenceAction.class);
+ suite.addTestSuite(InterfaceTrueAction.class);
+ suite.addTestSuite(SimplenmAction.class);
+ suite.addTestSuite(TopClassesAction.class);
+ // non emf tests: can not be run anymore
+ // suite.addTestSuite(DuplicateFieldAction.class);
+ // suite.addTestSuite(HierarchyQueryAction.class);
+ // suite.addTestSuite(ReferenceCycleAction.class);
+ // suite.addTestSuite(Relation1nAction.class);
+ // suite.addTestSuite(Relation3Action.class);
+ // suite.addTestSuite(Relation4Action.class);
+
+ // following test does not yet work for hibernate
+ // suite.addTestSuite(TestClassHierarchyAction.class);
+ // suite.addTestSuite(Relation2Action.class);
+ // suite.addTestSuite(Relation5Action.class);
+
+ return suite;
+ }
+}
diff --git a/tests/org.eclipse.emf.teneo.hibernate.test/src/org/eclipse/emf/teneo/hibernate/test/stores/HibernateTestStore.java b/tests/org.eclipse.emf.teneo.hibernate.test/src/org/eclipse/emf/teneo/hibernate/test/stores/HibernateTestStore.java
new file mode 100644
index 000000000..ba4ce8863
--- /dev/null
+++ b/tests/org.eclipse.emf.teneo.hibernate.test/src/org/eclipse/emf/teneo/hibernate/test/stores/HibernateTestStore.java
@@ -0,0 +1,417 @@
+/*
+ * Copyright 2005-2006, Elver.org (http://www.elver.org).
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.eclipse.emf.teneo.hibernate.test.stores;
+
+import java.sql.Connection;
+import java.util.List;
+import java.util.Properties;
+
+import junit.framework.TestCase;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.eclipse.emf.common.util.URI;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.EPackage;
+import org.eclipse.emf.ecore.resource.Resource;
+import org.eclipse.emf.ecore.resource.ResourceSet;
+import org.eclipse.emf.ecore.resource.impl.ResourceSetImpl;
+import org.eclipse.emf.teneo.PersistenceOptions;
+import org.eclipse.emf.teneo.annotations.pannotation.InheritanceType;
+import org.eclipse.emf.teneo.hibernate.HbDataStore;
+import org.eclipse.emf.teneo.hibernate.HbHelper;
+import org.eclipse.emf.teneo.hibernate.resource.HbResource;
+import org.eclipse.emf.teneo.hibernate.resource.HibernateResource;
+import org.eclipse.emf.teneo.hibernate.test.stores.adapters.HibernateTestDBAdapter;
+import org.eclipse.emf.teneo.test.StoreTestException;
+import org.eclipse.emf.teneo.test.stores.AbstractTestStore;
+import org.eclipse.emf.teneo.util.AssertUtil;
+import org.hibernate.LockMode;
+import org.hibernate.Query;
+import org.hibernate.Session;
+import org.hibernate.Transaction;
+import org.hibernate.cache.HashtableCacheProvider;
+import org.hibernate.cfg.Environment;
+import org.hibernate.impl.SessionImpl;
+import org.hibernate.metadata.ClassMetadata;
+import org.hibernate.persister.entity.JoinedSubclassEntityPersister;
+import org.hibernate.persister.entity.SingleTableEntityPersister;
+
+/**
+ * The hibernate test store encapsulates the datastore actions to a hibernate store.
+ *
+ * @author <a href="mailto:mtaal@elver.org">Martin Taal</a>
+ * @version $Revision: 1.1 $
+ */
+public class HibernateTestStore extends AbstractTestStore {
+ /** The logger */
+ private static Log log = LogFactory.getLog(HibernateTestStore.class);
+
+ /** The emf resource set used during the test */
+ protected final ResourceSet resourceSet = new ResourceSetImpl();
+
+ /** The EMFDatastore */
+ private HbDataStore emfDataStore;
+
+ /** The persistence manager for this test store */
+ private Session session;
+
+ /** The transaction object */
+ private Transaction tx;
+
+ /** Used to disable drop */
+ private boolean donotDrop = false;
+
+ /** The props used to create it all */
+ private Properties props;
+
+ /** the used epackages */
+ private EPackage[] epackages;
+
+ /** The inheritance logic followed */
+ private InheritanceType inheritanceType;
+
+ /**
+ * Constructor for emf test cases
+ */
+ public HibernateTestStore(HibernateTestDBAdapter adapter, EPackage[] epackages, Properties props, InheritanceType inheritanceType) {
+ super(adapter);
+ this.props = props;
+ this.epackages = epackages;
+ this.inheritanceType = inheritanceType;
+ init();
+ }
+
+ /** Creates/sets the persistence manager */
+ private void init() {
+ final HibernateTestDBAdapter adapter = (HibernateTestDBAdapter) getDatabaseAdapter();
+
+ props.setProperty(PersistenceOptions.INHERITANCE_MAPPING, inheritanceType.getName());
+
+ for (int i = 0; i < epackages.length; i++) {
+ log.debug("Creating HibernateTeststore for " + epackages[i].getName() + " adapter " + adapter.getClass().getName());
+ }
+
+ setDataStore();
+
+ log.debug("HibernateTestStore initialized");
+ }
+
+ /** Creates a Hibernate property set from the databaseadapter */
+ private Properties getHibernateProperties(HibernateTestDBAdapter dbadapter) {
+ final Properties props = new Properties();
+ props.setProperty(Environment.DRIVER, dbadapter.getDbDriver());
+ props.setProperty(Environment.USER, dbadapter.getDbUser());
+ props.setProperty(Environment.URL, dbadapter.getDbUrl());
+ props.setProperty(Environment.PASS, dbadapter.getDbPwd());
+ props.setProperty(Environment.DIALECT, dbadapter.getDialect());
+ //props.setProperty(Environment.CACHE_PROVIDER, HashtableCacheProvider.class.getName());
+ return props;
+ }
+
+ /** Sets the emfDataStore */
+ private void setDataStore() {
+ // currentTimeMillis is added to make it unique
+ emfDataStore = (HbDataStore)HbHelper.INSTANCE.createRegisterDataStore(getDatabaseAdapter().getDbName());
+ emfDataStore.setEPackages(epackages);
+ // set both hibernate and persistence props as we do not know the difference right now
+ emfDataStore.setHibernateProperties(getHibernateProperties((HibernateTestDBAdapter)getDatabaseAdapter()));
+ emfDataStore.setPersistenceProperties(props);
+ emfDataStore.initialize();
+ if (session != null) {
+ refresh();
+ } else {
+ session = emfDataStore.getSessionFactory().openSession();
+ tx = session.getTransaction();
+ }
+ // System.err.println(emfDataStore.getMappingXML());
+ }
+
+ /** Returns the mapping xml */
+ public String getMappingXML() {
+ return emfDataStore.getMappingXML();
+ }
+
+ /** Add an epackage to the list of epackages */
+ public void addEPackage(EPackage epackage) {
+ EPackage[] newEPacks = new EPackage[epackages.length + 1];
+ newEPacks[0] = epackage;
+ for (int i = 0; i < epackages.length; i++) {
+ newEPacks[i + 1] = epackages[i];
+ }
+ epackages = newEPacks;
+ }
+
+ /** Update the database schema */
+ public void updateSchema() {
+ emfDataStore.setEPackages(epackages);
+ emfDataStore.initialize();
+ refresh();
+ }
+
+ /** Creates a new persistence manager, actually to clear the cache */
+ public void refresh() {
+ if (tx != null && tx.isActive()) {
+ tx.rollback();
+ }
+ session.close();
+ session = emfDataStore.getSessionFactory().openSession();
+ tx = session.getTransaction();
+ }
+
+ /** Returns session */
+ public Session getSession() {
+ return session;
+ }
+
+ /** Returns a new session */
+ public Session getNewSession() {
+ return emfDataStore.getSessionFactory().openSession();
+ }
+
+ /** Begin transaction */
+ public void beginTransaction() {
+ tx.begin();
+ }
+
+ /** Commit transaction */
+ public void commitTransaction() {
+ tx.commit();
+
+ refresh();
+ }
+
+ /** Rollback transaction */
+ public void rollbackTransaction() {
+ if (tx.isActive()) tx.rollback();
+ refresh();
+ }
+
+ /** Store/Makepersistent */
+ public void store(Object object) {
+ session.persist(object);
+ }
+
+ /** Deletes an object */
+ public void deleteObject(Object obj) {
+ session.delete(obj);
+ }
+
+ /** Test if a delete fails */
+ public void checkDeleteFails(Class clazz) {
+ checkDelete(clazz, false); // replace class is called in checkDelete/getObjects
+ }
+
+ /** Test if a delete fails */
+ public void checkDeleteSucceeds(Class clazz) {
+ checkDelete(clazz, true); // replace class is called in CheckDelete/getObjects
+ }
+
+ /** Query for a class using a field and value pair */
+ public List query(Class clazz, String field, String value, int checkCount) {
+ // final Class interf = replaceClass(clazz);
+ return query("FROM " + getEntityName(clazz) + " WHERE " + field + "=\'" + value + "\'", checkCount);
+ }
+
+ /** Queries for an object */
+ public List query(Object query) {
+ return query(query, -1);
+ }
+
+ /** Queries for an object and checks the number */
+ public List query(Object query, int checkCount) {
+ final String qryStr = (String) query;
+ final Query qry = session.createQuery(qryStr);
+ final List result = qry.list();
+
+ if (checkCount > 0) {
+ TestCase.assertTrue("Expected " + checkCount + " object(s) for this query but there are " + result.size()
+ + " object(s) for the query " + qryStr, result.size() == checkCount);
+ }
+ return result;
+ }
+
+ /** Test if a delete fails */
+ private void checkDelete(Class clazz, boolean shouldSucceed) {
+ beginTransaction();
+ final List l = getObjects(clazz); // replace class is called in getObjects
+ try {
+ for (int i = 0; i < l.size(); i++) {
+ session.delete(l.get(i));
+ }
+ commitTransaction();
+ TestCase.assertTrue("The objects of class: " + clazz.getName() + " was deleted while this should not be possible",
+ shouldSucceed);
+ } catch (Exception e) {
+ e.printStackTrace(System.err);
+ TestCase.assertTrue("The objects of class: " + clazz.getName() + " was not deleted while this should be possible",
+ !shouldSucceed);
+ if (tx.isActive()) rollbackTransaction();
+ }
+ }
+
+ /** Return an object of a certain class, there should only be one in the databases */
+ public Object getObject(Class clazz) {
+ List l = getObjects(clazz); // replace class is called in getObjects
+ TestCase.assertTrue("There are " + l.size() + " object(s) of this class in the datastore, 1 was expected, class: "
+ + clazz.getName(), l.size() == 1);
+ return l.get(0);
+ }
+
+ /** Returns a list of object of a certain class */
+ public List getObjects(Class clazz) {
+ // final Class concrete = replaceClass(clazz);
+ final Query q = session.createQuery("FROM " + getEntityName(clazz));
+
+ return q.list();
+ }
+
+ /** Test the amount of objects of a certain class in the db */
+ public void checkNumber(Class clazz, int count) {
+ final List list = getObjects(clazz);
+ TestCase.assertTrue("Expected " + count + " object(s) but there are " + list.size()
+ + " object(s) of this class in the datastore: " + clazz.getName(), list.size() == count);
+ }
+
+ /** Flushes all updates to the underlying datastore */
+ public void flush() {
+ session.flush();
+ }
+
+ /** Is called just before the test */
+ public void setUp() {
+
+ }
+
+ /** Can be used to disabled dropping of the store, convenience for testing */
+ public void disableDrop() {
+ donotDrop = true;
+ }
+
+ /**
+ * Is called just after the test, the dropStore parameter can be used to prevent dropping the database when an error
+ */
+ public void doTearDown() {
+ AssertUtil.assertTrue("Transaction is still active at end of test", !((SessionImpl) session).isTransactionInProgress());
+
+ if (tx.isActive()) {
+ tx.rollback();
+ }
+
+ if (session.isOpen()) {
+ session.close();
+ }
+
+ HbHelper.INSTANCE.closeAll();
+
+ if (!donotDrop) {
+ //dropDatabase();
+ }
+ }
+
+ /** Returns true if the transaction is still active */
+ public boolean transactionActive() {
+ return ((SessionImpl) session).isTransactionInProgress();
+ }
+
+ /** Base method to get a resource belonging to the pmf of this test case */
+ public Resource getResource() {
+ return getResource(null);
+ }
+
+ /** Base method to get a resource belonging to the session of this test case */
+ public Resource getResource(String extraParam) {
+ String uriStr = "hibernate://?" + HibernateResource.DS_NAME_PARAM + "=" + emfDataStore.getName();
+
+ if (extraParam != null) {
+ uriStr += "&" + extraParam;
+ }
+ final URI uri = URI.createURI(uriStr);
+ log.debug("Getting resource using uri: " + uri.toString());
+ final Resource res = resourceSet.createResource(uri);
+ assert (res instanceof HbResource);
+ return res;
+ }
+
+ /**
+ * Replaces a passed EMF Interface by its concrete class private Class replaceClass(Class interfaze) { if
+ * (!interfaze.isInterface()) return interfaze; if (!EObject.class.isAssignableFrom(interfaze)) return interfaze;
+ *
+ * return HibernateHelper.INSTANCE.getInstanceClass(interfaze); }
+ */
+
+ /** Gets the referedto list */
+ public Object[] getCrossReferencers(EObject obj, boolean container) {
+ if (container) {
+ return new Object[]{obj.eContainer()};
+ // final EObject eobj = ((HbDataStore)emfDataStore).getContainer(session, obj);
+ // if (eobj == null)
+ // {
+ // return new EObject[0];
+ // }
+ // return new EObject[] {eobj};
+ } else {
+ return emfDataStore.getCrossReferencers(session, obj);
+ }
+ }
+
+ /** Gets the container list */
+ public boolean setContainer(EObject obj) {
+ return true;
+ }
+
+ /** Refreshes the object from the datastore */
+ public void refresh(Object obj) {
+ session.refresh(obj, LockMode.NONE);
+ }
+
+ /** Check inheritance strategy */
+ public boolean isInheritanceStrategy(String name, InheritanceType strategy) {
+ final String realName = name.substring(name.lastIndexOf('.') + 1, name.length() - 4);
+ final ClassMetadata cmd = session.getSessionFactory().getClassMetadata(realName);
+ if (strategy.equals(InheritanceType.SINGLE_TABLE_LITERAL)) {
+ return cmd instanceof SingleTableEntityPersister;
+ }
+ if (strategy.equals(InheritanceType.JOINED_LITERAL)) {
+ return cmd instanceof JoinedSubclassEntityPersister;
+ }
+ throw new StoreTestException("Strategy: " + strategy.toString() + " not supported ");
+ }
+
+ /** Gets a database connection using the adapters connection info */
+ public Connection getConnection() {
+ return getDatabaseAdapter().getConnection();
+ }
+
+ /** Returns the query name to use for the instance */
+ private String getEntityName(Class clazz) {
+ return clazz.getName().substring(clazz.getName().lastIndexOf('.') + 1);
+ }
+
+ /**
+ * @return the emfDataStore
+ */
+ public HbDataStore getEmfDataStore() {
+ return emfDataStore;
+ }
+
+ /**
+ * @return the inheritanceType
+ */
+ public InheritanceType getInheritanceType() {
+ return inheritanceType;
+ }
+} \ No newline at end of file
diff --git a/tests/org.eclipse.emf.teneo.hibernate.test/src/org/eclipse/emf/teneo/hibernate/test/stores/HibernateTestStoreFactory.java b/tests/org.eclipse.emf.teneo.hibernate.test/src/org/eclipse/emf/teneo/hibernate/test/stores/HibernateTestStoreFactory.java
new file mode 100644
index 000000000..fd72aec14
--- /dev/null
+++ b/tests/org.eclipse.emf.teneo.hibernate.test/src/org/eclipse/emf/teneo/hibernate/test/stores/HibernateTestStoreFactory.java
@@ -0,0 +1,40 @@
+/*
+ * Copyright 2004-2006, Elver.org (http://www.elver.org).
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.eclipse.emf.teneo.hibernate.test.stores;
+
+import java.util.Properties;
+
+import org.eclipse.emf.ecore.EPackage;
+import org.eclipse.emf.teneo.annotations.pannotation.InheritanceType;
+import org.eclipse.emf.teneo.hibernate.test.stores.adapters.HibernateTestDBAdapter;
+import org.eclipse.emf.teneo.test.stores.AbstractTestStoreFactory;
+import org.eclipse.emf.teneo.test.stores.TestDatabaseAdapter;
+import org.eclipse.emf.teneo.test.stores.TestStore;
+
+/**
+ * Creates a test store.
+ *
+ * @author <a href="mailto:mtaal@elver.org">Martin Taal</a>
+ * @version $Revision: 1.1 $
+ */
+public class HibernateTestStoreFactory extends AbstractTestStoreFactory {
+
+ /** Creates the actual specific test store */
+ protected TestStore createStoreInstance(TestDatabaseAdapter adapter, EPackage[] epackages, String mappingFileLocation,
+ Properties props, InheritanceType inheritanceType) {
+ return new HibernateTestStore((HibernateTestDBAdapter) adapter, epackages, props, inheritanceType);
+ }
+}
diff --git a/tests/org.eclipse.emf.teneo.hibernate.test/src/org/eclipse/emf/teneo/hibernate/test/stores/adapters/HibernateHsqlDBAdapter.java b/tests/org.eclipse.emf.teneo.hibernate.test/src/org/eclipse/emf/teneo/hibernate/test/stores/adapters/HibernateHsqlDBAdapter.java
new file mode 100644
index 000000000..24c652771
--- /dev/null
+++ b/tests/org.eclipse.emf.teneo.hibernate.test/src/org/eclipse/emf/teneo/hibernate/test/stores/adapters/HibernateHsqlDBAdapter.java
@@ -0,0 +1,35 @@
+/*
+ * Copyright 2005-2006, Elver.org (http://www.elver.org).
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.eclipse.emf.teneo.hibernate.test.stores.adapters;
+
+import org.eclipse.emf.teneo.test.stores.HsqldbTestDatabaseAdapter;
+import org.hibernate.dialect.HSQLDialect;
+
+/**
+ * Overridden to add the hibernate database dialect.
+ *
+ * @author <a href="mailto:marchign@fastmail.fm">Davide Marchignoli</a>
+ * @version $Revision: 1.1 $
+*/
+
+public class HibernateHsqlDBAdapter extends HsqldbTestDatabaseAdapter implements HibernateTestDBAdapter
+{
+ /** Return the hibernate dialted */
+ public String getDialect() {
+ return HSQLDialect.class.getName();
+ }
+} \ No newline at end of file
diff --git a/tests/org.eclipse.emf.teneo.hibernate.test/src/org/eclipse/emf/teneo/hibernate/test/stores/adapters/HibernateMcssqlDBAdapter.java b/tests/org.eclipse.emf.teneo.hibernate.test/src/org/eclipse/emf/teneo/hibernate/test/stores/adapters/HibernateMcssqlDBAdapter.java
new file mode 100644
index 000000000..86028a934
--- /dev/null
+++ b/tests/org.eclipse.emf.teneo.hibernate.test/src/org/eclipse/emf/teneo/hibernate/test/stores/adapters/HibernateMcssqlDBAdapter.java
@@ -0,0 +1,35 @@
+/*
+ * Copyright 2005-2006, Elver.org (http://www.elver.org).
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.eclipse.emf.teneo.hibernate.test.stores.adapters;
+
+import org.eclipse.emf.teneo.test.stores.MssqlJDBCTestDatabaseAdapter;
+import org.hibernate.dialect.SQLServerDialect;
+
+/**
+ * Overridden to add the hibernate database dialect.
+ *
+ * @author <a href="mailto:marchign@fastmail.fm">Davide Marchignoli</a>
+ * @version $Revision: 1.1 $
+*/
+
+public class HibernateMcssqlDBAdapter extends MssqlJDBCTestDatabaseAdapter implements HibernateTestDBAdapter
+{
+ /** Return the hibernate dialted */
+ public String getDialect() {
+ return SQLServerDialect.class.getName();
+ }
+} \ No newline at end of file
diff --git a/tests/org.eclipse.emf.teneo.hibernate.test/src/org/eclipse/emf/teneo/hibernate/test/stores/adapters/HibernateMssqlDBAdapter.java b/tests/org.eclipse.emf.teneo.hibernate.test/src/org/eclipse/emf/teneo/hibernate/test/stores/adapters/HibernateMssqlDBAdapter.java
new file mode 100644
index 000000000..c441457b0
--- /dev/null
+++ b/tests/org.eclipse.emf.teneo.hibernate.test/src/org/eclipse/emf/teneo/hibernate/test/stores/adapters/HibernateMssqlDBAdapter.java
@@ -0,0 +1,35 @@
+/*
+ * Copyright 2005-2006, Elver.org (http://www.elver.org).
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.eclipse.emf.teneo.hibernate.test.stores.adapters;
+
+import org.eclipse.emf.teneo.test.stores.BaseTestDatabaseAdapter;
+import org.hibernate.dialect.SQLServerDialect;
+
+/**
+ * Overridden to add the hibernate database dialect.
+ *
+ * @author <a href="mailto:marchign@fastmail.fm">Davide Marchignoli</a>
+ * @version $Revision: 1.1 $
+*/
+
+public class HibernateMssqlDBAdapter extends BaseTestDatabaseAdapter implements HibernateTestDBAdapter
+{
+ /** Return the hibernate dialted */
+ public String getDialect() {
+ return SQLServerDialect.class.getName();
+ }
+} \ No newline at end of file
diff --git a/tests/org.eclipse.emf.teneo.hibernate.test/src/org/eclipse/emf/teneo/hibernate/test/stores/adapters/HibernateMysqlDBAdapter.java b/tests/org.eclipse.emf.teneo.hibernate.test/src/org/eclipse/emf/teneo/hibernate/test/stores/adapters/HibernateMysqlDBAdapter.java
new file mode 100644
index 000000000..8cba55b9a
--- /dev/null
+++ b/tests/org.eclipse.emf.teneo.hibernate.test/src/org/eclipse/emf/teneo/hibernate/test/stores/adapters/HibernateMysqlDBAdapter.java
@@ -0,0 +1,36 @@
+/*
+ * Copyright 2005-2006, Elver.org (http://www.elver.org).
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.eclipse.emf.teneo.hibernate.test.stores.adapters;
+
+import org.eclipse.emf.teneo.test.stores.BaseTestDatabaseAdapter;
+import org.hibernate.dialect.MySQLDialect;
+import org.hibernate.dialect.MySQLInnoDBDialect;
+
+/**
+ * Overridden to add the hibernate database dialect.
+ *
+ * @author <a href="mailto:marchign@fastmail.fm">Davide Marchignoli</a>
+ * @version $Revision: 1.1 $
+*/
+
+public class HibernateMysqlDBAdapter extends BaseTestDatabaseAdapter implements HibernateTestDBAdapter
+{
+ /** Return the hibernate dialted */
+ public String getDialect() {
+ return MySQLInnoDBDialect.class.getName();
+ }
+} \ No newline at end of file
diff --git a/tests/org.eclipse.emf.teneo.hibernate.test/src/org/eclipse/emf/teneo/hibernate/test/stores/adapters/HibernatePgsqlDBAdapter.java b/tests/org.eclipse.emf.teneo.hibernate.test/src/org/eclipse/emf/teneo/hibernate/test/stores/adapters/HibernatePgsqlDBAdapter.java
new file mode 100644
index 000000000..4de5db674
--- /dev/null
+++ b/tests/org.eclipse.emf.teneo.hibernate.test/src/org/eclipse/emf/teneo/hibernate/test/stores/adapters/HibernatePgsqlDBAdapter.java
@@ -0,0 +1,35 @@
+/*
+ * Copyright 2005-2006, Elver.org (http://www.elver.org).
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.eclipse.emf.teneo.hibernate.test.stores.adapters;
+
+import org.eclipse.emf.teneo.test.stores.PgsqlTestDatabaseAdapter;
+import org.hibernate.dialect.PostgreSQLDialect;
+
+/**
+ * Overridden to add the hibernate database dialect.
+ *
+ * @author <a href="mailto:marchign@fastmail.fm">Davide Marchignoli</a>
+ * @version $Revision: 1.1 $
+*/
+
+public class HibernatePgsqlDBAdapter extends PgsqlTestDatabaseAdapter implements HibernateTestDBAdapter
+{
+ /** Return the hibernate dialted */
+ public String getDialect() {
+ return PostgreSQLDialect.class.getName();
+ }
+} \ No newline at end of file
diff --git a/tests/org.eclipse.emf.teneo.hibernate.test/src/org/eclipse/emf/teneo/hibernate/test/stores/adapters/HibernateTestDBAdapter.java b/tests/org.eclipse.emf.teneo.hibernate.test/src/org/eclipse/emf/teneo/hibernate/test/stores/adapters/HibernateTestDBAdapter.java
new file mode 100644
index 000000000..acced390e
--- /dev/null
+++ b/tests/org.eclipse.emf.teneo.hibernate.test/src/org/eclipse/emf/teneo/hibernate/test/stores/adapters/HibernateTestDBAdapter.java
@@ -0,0 +1,9 @@
+package org.eclipse.emf.teneo.hibernate.test.stores.adapters;
+
+import org.eclipse.emf.teneo.test.stores.TestDatabaseAdapter;
+
+public interface HibernateTestDBAdapter extends TestDatabaseAdapter {
+
+ /** The getDialect method */
+ public String getDialect();
+} \ No newline at end of file
diff --git a/tests/org.eclipse.emf.teneo.hibernate.test/src/org/eclipse/emf/teneo/hibernate/test/test/AllTests.java b/tests/org.eclipse.emf.teneo.hibernate.test/src/org/eclipse/emf/teneo/hibernate/test/test/AllTests.java
new file mode 100644
index 000000000..927956f71
--- /dev/null
+++ b/tests/org.eclipse.emf.teneo.hibernate.test/src/org/eclipse/emf/teneo/hibernate/test/test/AllTests.java
@@ -0,0 +1,39 @@
+/*
+ * Copyright 2005-2006, Elver.org (http://www.elver.org).
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.eclipse.emf.teneo.hibernate.test.test;
+
+import junit.framework.Test;
+import junit.framework.TestSuite;
+
+import org.eclipse.emf.teneo.hibernate.test.HibernateTestbed;
+import org.eclipse.emf.teneo.test.conf.MultiCfgTestSuite;
+
+/**
+ * All tests
+ *
+ * @author <a href="mailto:mtaal@elver.org">Martin Taal</a>
+ * @version $Revision: 1.1 $
+ */
+public class AllTests {
+
+ public static Test suite() {
+ TestSuite suite = new MultiCfgTestSuite("Test for org.eclipse.emf.teneo.hibernate.test.issues", HibernateTestbed.instance()
+ .getConfigurations());
+
+ //suite.addTestSuite(DomainAction.class);
+ return suite;
+ }
+}
diff --git a/tests/org.eclipse.emf.teneo.hibernate.test/src/org/eclipse/emf/teneo/samples/emf/hibernate/usertype/Name.java b/tests/org.eclipse.emf.teneo.hibernate.test/src/org/eclipse/emf/teneo/samples/emf/hibernate/usertype/Name.java
new file mode 100644
index 000000000..e0b222c20
--- /dev/null
+++ b/tests/org.eclipse.emf.teneo.hibernate.test/src/org/eclipse/emf/teneo/samples/emf/hibernate/usertype/Name.java
@@ -0,0 +1,53 @@
+package org.eclipse.emf.teneo.samples.emf.hibernate.usertype;
+
+import java.io.Serializable;
+
+public class Name implements Serializable {
+ private String first;
+
+ private String last;
+
+ public Name() {
+ }
+
+ public Name(String first, String last) {
+ this.first = first;
+ this.last = last;
+ }
+
+ public String getFirst() {
+ return first;
+ }
+
+ public void setFirst(String first) {
+ this.first = first;
+ }
+
+ public String getLast() {
+ return last;
+ }
+
+ public void setLast(String last) {
+ this.last = last;
+ }
+
+ public boolean equals(Object obj) {
+ if (!(obj instanceof Name)) {
+ return false;
+ }
+ Name other = (Name) obj;
+ return ((this.first == null && other.first == null) || this.first.equals(other.first))
+ && (this.last == null && other.last == null) || this.last.equals(other.last);
+ }
+
+ public int hashCode() {
+ int result = 17;
+ result = 37 * result + first.hashCode();
+ result = 37 * result + last.hashCode();
+ return result;
+ }
+
+ public String toString() {
+ return first + " " + last;
+ }
+}
diff --git a/tests/org.eclipse.emf.teneo.hibernate.test/src/org/eclipse/emf/teneo/samples/emf/hibernate/usertype/NameType.java b/tests/org.eclipse.emf.teneo.hibernate.test/src/org/eclipse/emf/teneo/samples/emf/hibernate/usertype/NameType.java
new file mode 100644
index 000000000..738629724
--- /dev/null
+++ b/tests/org.eclipse.emf.teneo.hibernate.test/src/org/eclipse/emf/teneo/samples/emf/hibernate/usertype/NameType.java
@@ -0,0 +1,74 @@
+package org.eclipse.emf.teneo.samples.emf.hibernate.usertype;
+
+import java.io.Serializable;
+import java.sql.PreparedStatement;
+import java.sql.ResultSet;
+import java.sql.SQLException;
+import java.sql.Types;
+
+import org.hibernate.Hibernate;
+import org.hibernate.HibernateException;
+import org.hibernate.usertype.UserType;
+
+/**
+ * Trivial example implementation of a UserType.
+ */
+public class NameType implements UserType {
+
+ private static final int[] SQL_TYPES = new int[] { Types.VARCHAR, Types.VARCHAR };
+
+ public Object assemble(Serializable cached, Object owner) throws HibernateException {
+ return deepCopy(cached);
+ }
+
+ public Object deepCopy(Object value) throws HibernateException {
+ Name name = (Name) value;
+ return new Name(name.getFirst(), name.getLast());
+ }
+
+ public Serializable disassemble(Object value) throws HibernateException {
+ return (Serializable) deepCopy(value);
+ }
+
+ public boolean equals(Object x, Object y) throws HibernateException {
+ if (x == y) {
+ return true;
+ } else if (x == null || y == null) {
+ return false;
+ }
+ return x.equals(y);
+ }
+
+ public int hashCode(Object x) throws HibernateException {
+ return x.hashCode();
+ }
+
+ public boolean isMutable() {
+ return true;
+ }
+
+ public Object nullSafeGet(ResultSet rs, String[] names, Object owner) throws HibernateException, SQLException {
+ String first = (String) Hibernate.STRING.nullSafeGet(rs, names[0]);
+ String last = (String) Hibernate.STRING.nullSafeGet(rs, names[1]);
+ return new Name(first, last);
+ }
+
+ public void nullSafeSet(PreparedStatement st, Object value, int index) throws HibernateException, SQLException {
+ Name name = (Name) value;
+ Hibernate.STRING.nullSafeSet(st, name.getFirst(), index);
+ Hibernate.STRING.nullSafeSet(st, name.getLast(), index + 1);
+ }
+
+ public Object replace(Object original, Object target, Object owner) throws HibernateException {
+ return original;
+ }
+
+ public Class returnedClass() {
+ return Name.class;
+ }
+
+ public int[] sqlTypes() {
+ return SQL_TYPES;
+ }
+
+}
diff --git a/tests/org.eclipse.emf.teneo.hibernate.test/src/org/eclipse/emf/teneo/samples/emf/hibernate/usertype/Person.java b/tests/org.eclipse.emf.teneo.hibernate.test/src/org/eclipse/emf/teneo/samples/emf/hibernate/usertype/Person.java
new file mode 100644
index 000000000..670fdbe78
--- /dev/null
+++ b/tests/org.eclipse.emf.teneo.hibernate.test/src/org/eclipse/emf/teneo/samples/emf/hibernate/usertype/Person.java
@@ -0,0 +1,55 @@
+/**
+ * <copyright>
+ * </copyright>
+ *
+ * $Id: Person.java,v 1.1 2006/07/06 05:10:40 mtaal Exp $
+ */
+package org.eclipse.emf.teneo.samples.emf.hibernate.usertype;
+
+import org.eclipse.emf.ecore.EObject;
+
+/**
+ * <!-- begin-user-doc -->
+ * A representation of the model object '<em><b>Person</b></em>'.
+ * <!-- end-user-doc -->
+ *
+ * <p>
+ * The following features are supported:
+ * <ul>
+ * <li>{@link org.eclipse.emf.teneo.samples.emf.hibernate.usertype.Person#getName <em>Name</em>}</li>
+ * </ul>
+ * </p>
+ *
+ * @see org.eclipse.emf.teneo.samples.emf.hibernate.usertype.UsertypePackage#getPerson()
+ * @model extendedMetaData="name='Person' kind='elementOnly'"
+ * @generated
+ */
+public interface Person extends EObject {
+ /**
+ * Returns the value of the '<em><b>Name</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>Name</em>' containment reference isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ * @return the value of the '<em>Name</em>' attribute.
+ * @see #setName(Name)
+ * @see org.eclipse.emf.teneo.samples.emf.hibernate.usertype.UsertypePackage#getPerson_Name()
+ * @model unique="false" dataType="org.eclipse.emf.teneo.samples.emf.hibernate.usertype.Name" required="true"
+ * extendedMetaData="kind='element' name='name'"
+ * @generated
+ */
+ Name getName();
+
+ /**
+ * Sets the value of the '{@link org.eclipse.emf.teneo.samples.emf.hibernate.usertype.Person#getName <em>Name</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @param value the new value of the '<em>Name</em>' attribute.
+ * @see #getName()
+ * @generated
+ */
+ void setName(Name value);
+
+} // Person \ No newline at end of file
diff --git a/tests/org.eclipse.emf.teneo.hibernate.test/src/org/eclipse/emf/teneo/samples/emf/hibernate/usertype/UsertypeFactory.java b/tests/org.eclipse.emf.teneo.hibernate.test/src/org/eclipse/emf/teneo/samples/emf/hibernate/usertype/UsertypeFactory.java
new file mode 100644
index 000000000..d74478bd3
--- /dev/null
+++ b/tests/org.eclipse.emf.teneo.hibernate.test/src/org/eclipse/emf/teneo/samples/emf/hibernate/usertype/UsertypeFactory.java
@@ -0,0 +1,46 @@
+/**
+ * <copyright>
+ * </copyright>
+ *
+ * $Id: UsertypeFactory.java,v 1.1 2006/07/06 05:10:40 mtaal Exp $
+ */
+package org.eclipse.emf.teneo.samples.emf.hibernate.usertype;
+
+import org.eclipse.emf.ecore.EFactory;
+
+/**
+ * <!-- begin-user-doc -->
+ * The <b>Factory</b> for the model.
+ * It provides a create method for each non-abstract class of the model.
+ * <!-- end-user-doc -->
+ * @see org.eclipse.emf.teneo.samples.emf.hibernate.usertype.UsertypePackage
+ * @generated
+ */
+public interface UsertypeFactory extends EFactory {
+ /**
+ * The singleton instance of the factory.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ UsertypeFactory eINSTANCE = org.eclipse.emf.teneo.samples.emf.hibernate.usertype.impl.UsertypeFactoryImpl.init();
+
+ /**
+ * Returns a new object of class '<em>Person</em>'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return a new object of class '<em>Person</em>'.
+ * @generated
+ */
+ Person createPerson();
+
+ /**
+ * Returns the package supported by this factory.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the package supported by this factory.
+ * @generated
+ */
+ UsertypePackage getUsertypePackage();
+
+} //UsertypeFactory
diff --git a/tests/org.eclipse.emf.teneo.hibernate.test/src/org/eclipse/emf/teneo/samples/emf/hibernate/usertype/UsertypePackage.java b/tests/org.eclipse.emf.teneo.hibernate.test/src/org/eclipse/emf/teneo/samples/emf/hibernate/usertype/UsertypePackage.java
new file mode 100644
index 000000000..6c13a723d
--- /dev/null
+++ b/tests/org.eclipse.emf.teneo.hibernate.test/src/org/eclipse/emf/teneo/samples/emf/hibernate/usertype/UsertypePackage.java
@@ -0,0 +1,192 @@
+/**
+ * <copyright>
+ * </copyright>
+ *
+ * $Id: UsertypePackage.java,v 1.1 2006/07/06 05:10:40 mtaal Exp $
+ */
+package org.eclipse.emf.teneo.samples.emf.hibernate.usertype;
+
+import org.eclipse.emf.ecore.EAttribute;
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.EDataType;
+import org.eclipse.emf.ecore.EPackage;
+import org.eclipse.emf.ecore.EReference;
+
+/**
+ * <!-- begin-user-doc -->
+ * The <b>Package</b> for the model.
+ * It contains accessors for the meta objects to represent
+ * <ul>
+ * <li>each class,</li>
+ * <li>each feature of each class,</li>
+ * <li>each enum,</li>
+ * <li>and each data type</li>
+ * </ul>
+ * <!-- end-user-doc -->
+ * @see org.eclipse.emf.teneo.samples.emf.hibernate.usertype.UsertypeFactory
+ * @model kind="package"
+ * @generated
+ */
+public interface UsertypePackage extends EPackage {
+ /**
+ * The package name.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ String eNAME = "usertype";
+
+ /**
+ * The package namespace URI.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ String eNS_URI = "http://www.elver.org/samples/emf/hibernate/usertype";
+
+ /**
+ * The package namespace name.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ String eNS_PREFIX = "usertype";
+
+ /**
+ * The singleton instance of the package.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ UsertypePackage eINSTANCE = org.eclipse.emf.teneo.samples.emf.hibernate.usertype.impl.UsertypePackageImpl.init();
+
+ /**
+ * The meta object id for the '{@link org.eclipse.emf.teneo.samples.emf.hibernate.usertype.impl.PersonImpl <em>Person</em>}' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see org.eclipse.emf.teneo.samples.emf.hibernate.usertype.impl.PersonImpl
+ * @see org.eclipse.emf.teneo.samples.emf.hibernate.usertype.impl.UsertypePackageImpl#getPerson()
+ * @generated
+ */
+ int PERSON = 0;
+
+ /**
+ * The feature id for the '<em><b>Name</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int PERSON__NAME = 0;
+
+ /**
+ * The number of structural features of the '<em>Person</em>' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int PERSON_FEATURE_COUNT = 1;
+
+
+ /**
+ * The meta object id for the '<em>Name</em>' data type.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see org.eclipse.emf.teneo.samples.emf.hibernate.usertype.Name
+ * @see org.eclipse.emf.teneo.samples.emf.hibernate.usertype.impl.UsertypePackageImpl#getName_()
+ * @generated
+ */
+ int NAME = 1;
+
+
+ /**
+ * Returns the meta object for class '{@link org.eclipse.emf.teneo.samples.emf.hibernate.usertype.Person <em>Person</em>}'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the meta object for class '<em>Person</em>'.
+ * @see org.eclipse.emf.teneo.samples.emf.hibernate.usertype.Person
+ * @generated
+ */
+ EClass getPerson();
+
+ /**
+ * Returns the meta object for the attribute '{@link org.eclipse.emf.teneo.samples.emf.hibernate.usertype.Person#getName <em>Name</em>}'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the meta object for the attribute '<em>Name</em>'.
+ * @see org.eclipse.emf.teneo.samples.emf.hibernate.usertype.Person#getName()
+ * @see #getPerson()
+ * @generated
+ */
+ EAttribute getPerson_Name();
+
+ /**
+ * Returns the meta object for data type '{@link org.eclipse.emf.teneo.samples.emf.hibernate.usertype.Name <em>Name</em>}'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the meta object for data type '<em>Name</em>'.
+ * @see org.eclipse.emf.teneo.samples.emf.hibernate.usertype.Name
+ * @model instanceClass="org.eclipse.emf.teneo.samples.emf.hibernate.usertype.Name"
+ * annotation="http://hibernate.elver.org/Type type='org.eclipse.emf.teneo.samples.emf.hibernate.usertype.NameType'"
+ * annotation="http://hibernate.elver.org/Columns value='c1 c2'"
+ * annotation="http://ejb.elver.org/Column/c1 name='first_name'"
+ * annotation="http://ejb.elver.org/Column/c2 name='last_name'"
+ * extendedMetaData="name='Name'"
+ * @generated
+ */
+ EDataType getName_();
+
+ /**
+ * Returns the factory that creates the instances of the model.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the factory that creates the instances of the model.
+ * @generated
+ */
+ UsertypeFactory getUsertypeFactory();
+
+ /**
+ * <!-- begin-user-doc -->
+ * Defines literals for the meta objects that represent
+ * <ul>
+ * <li>each class,</li>
+ * <li>each feature of each class,</li>
+ * <li>each enum,</li>
+ * <li>and each data type</li>
+ * </ul>
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ interface Literals {
+ /**
+ * The meta object literal for the '{@link org.eclipse.emf.teneo.samples.emf.hibernate.usertype.impl.PersonImpl <em>Person</em>}' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see org.eclipse.emf.teneo.samples.emf.hibernate.usertype.impl.PersonImpl
+ * @see org.eclipse.emf.teneo.samples.emf.hibernate.usertype.impl.UsertypePackageImpl#getPerson()
+ * @generated
+ */
+ EClass PERSON = eINSTANCE.getPerson();
+
+ /**
+ * The meta object literal for the '<em><b>Name</b></em>' attribute feature.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ EAttribute PERSON__NAME = eINSTANCE.getPerson_Name();
+
+ /**
+ * The meta object literal for the '<em>Name</em>' data type.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see org.eclipse.emf.teneo.samples.emf.hibernate.usertype.Name
+ * @see org.eclipse.emf.teneo.samples.emf.hibernate.usertype.impl.UsertypePackageImpl#getName_()
+ * @generated
+ */
+ EDataType NAME = eINSTANCE.getName_();
+
+ }
+
+} //UsertypePackage
diff --git a/tests/org.eclipse.emf.teneo.hibernate.test/src/org/eclipse/emf/teneo/samples/emf/hibernate/usertype/impl/PersonImpl.java b/tests/org.eclipse.emf.teneo.hibernate.test/src/org/eclipse/emf/teneo/samples/emf/hibernate/usertype/impl/PersonImpl.java
new file mode 100644
index 000000000..7e2835079
--- /dev/null
+++ b/tests/org.eclipse.emf.teneo.hibernate.test/src/org/eclipse/emf/teneo/samples/emf/hibernate/usertype/impl/PersonImpl.java
@@ -0,0 +1,165 @@
+/**
+ * <copyright>
+ * </copyright>
+ *
+ * $Id: PersonImpl.java,v 1.1 2006/07/06 05:10:40 mtaal Exp $
+ */
+package org.eclipse.emf.teneo.samples.emf.hibernate.usertype.impl;
+
+import org.eclipse.emf.common.notify.Notification;
+import org.eclipse.emf.common.notify.NotificationChain;
+
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.InternalEObject;
+
+import org.eclipse.emf.ecore.impl.ENotificationImpl;
+import org.eclipse.emf.ecore.impl.EObjectImpl;
+
+import org.eclipse.emf.teneo.samples.emf.hibernate.usertype.Name;
+import org.eclipse.emf.teneo.samples.emf.hibernate.usertype.Person;
+import org.eclipse.emf.teneo.samples.emf.hibernate.usertype.UsertypePackage;
+
+/**
+ * <!-- begin-user-doc -->
+ * An implementation of the model object '<em><b>Person</b></em>'.
+ * <!-- end-user-doc -->
+ * <p>
+ * The following features are implemented:
+ * <ul>
+ * <li>{@link org.eclipse.emf.teneo.samples.emf.hibernate.usertype.impl.PersonImpl#getName <em>Name</em>}</li>
+ * </ul>
+ * </p>
+ *
+ * @generated
+ */
+public class PersonImpl extends EObjectImpl implements Person {
+ /**
+ * The default value of the '{@link #getName() <em>Name</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getName()
+ * @generated
+ * @ordered
+ */
+ protected static final Name NAME_EDEFAULT = null;
+
+ /**
+ * The cached value of the '{@link #getName() <em>Name</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getName()
+ * @generated
+ * @ordered
+ */
+ protected Name name = NAME_EDEFAULT;
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected PersonImpl() {
+ super();
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected EClass eStaticClass() {
+ return UsertypePackage.Literals.PERSON;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public Name getName() {
+ return name;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void setName(Name newName) {
+ Name oldName = name;
+ name = newName;
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.SET, UsertypePackage.PERSON__NAME, oldName, name));
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public Object eGet(int featureID, boolean resolve, boolean coreType) {
+ switch (featureID) {
+ case UsertypePackage.PERSON__NAME:
+ return getName();
+ }
+ return super.eGet(featureID, resolve, coreType);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void eSet(int featureID, Object newValue) {
+ switch (featureID) {
+ case UsertypePackage.PERSON__NAME:
+ setName((Name)newValue);
+ return;
+ }
+ super.eSet(featureID, newValue);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void eUnset(int featureID) {
+ switch (featureID) {
+ case UsertypePackage.PERSON__NAME:
+ setName(NAME_EDEFAULT);
+ return;
+ }
+ super.eUnset(featureID);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public boolean eIsSet(int featureID) {
+ switch (featureID) {
+ case UsertypePackage.PERSON__NAME:
+ return NAME_EDEFAULT == null ? name != null : !NAME_EDEFAULT.equals(name);
+ }
+ return super.eIsSet(featureID);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public String toString() {
+ if (eIsProxy()) return super.toString();
+
+ StringBuffer result = new StringBuffer(super.toString());
+ result.append(" (name: ");
+ result.append(name);
+ result.append(')');
+ return result.toString();
+ }
+
+} //PersonImpl \ No newline at end of file
diff --git a/tests/org.eclipse.emf.teneo.hibernate.test/src/org/eclipse/emf/teneo/samples/emf/hibernate/usertype/impl/UsertypeFactoryImpl.java b/tests/org.eclipse.emf.teneo.hibernate.test/src/org/eclipse/emf/teneo/samples/emf/hibernate/usertype/impl/UsertypeFactoryImpl.java
new file mode 100644
index 000000000..c8fee0424
--- /dev/null
+++ b/tests/org.eclipse.emf.teneo.hibernate.test/src/org/eclipse/emf/teneo/samples/emf/hibernate/usertype/impl/UsertypeFactoryImpl.java
@@ -0,0 +1,147 @@
+/**
+ * <copyright>
+ * </copyright>
+ *
+ * $Id: UsertypeFactoryImpl.java,v 1.1 2006/07/06 05:10:39 mtaal Exp $
+ */
+package org.eclipse.emf.teneo.samples.emf.hibernate.usertype.impl;
+
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.EDataType;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.EPackage;
+
+import org.eclipse.emf.ecore.impl.EFactoryImpl;
+
+import org.eclipse.emf.ecore.plugin.EcorePlugin;
+
+import org.eclipse.emf.ecore.xml.type.XMLTypeFactory;
+import org.eclipse.emf.ecore.xml.type.XMLTypePackage;
+
+import org.eclipse.emf.teneo.samples.emf.hibernate.usertype.*;
+
+/**
+ * <!-- begin-user-doc -->
+ * An implementation of the model <b>Factory</b>.
+ * <!-- end-user-doc -->
+ * @generated
+ */
+public class UsertypeFactoryImpl extends EFactoryImpl implements UsertypeFactory {
+ /**
+ * Creates the default factory implementation.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public static UsertypeFactory init() {
+ try {
+ UsertypeFactory theUsertypeFactory = (UsertypeFactory)EPackage.Registry.INSTANCE.getEFactory("http://www.elver.org/samples/emf/hibernate/usertype");
+ if (theUsertypeFactory != null) {
+ return theUsertypeFactory;
+ }
+ }
+ catch (Exception exception) {
+ EcorePlugin.INSTANCE.log(exception);
+ }
+ return new UsertypeFactoryImpl();
+ }
+
+ /**
+ * Creates an instance of the factory.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public UsertypeFactoryImpl() {
+ super();
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EObject create(EClass eClass) {
+ switch (eClass.getClassifierID()) {
+ case UsertypePackage.PERSON: return createPerson();
+ default:
+ throw new IllegalArgumentException("The class '" + eClass.getName() + "' is not a valid classifier");
+ }
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public Object createFromString(EDataType eDataType, String initialValue) {
+ switch (eDataType.getClassifierID()) {
+ case UsertypePackage.NAME:
+ return createNameFromString(eDataType, initialValue);
+ default:
+ throw new IllegalArgumentException("The datatype '" + eDataType.getName() + "' is not a valid classifier");
+ }
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public String convertToString(EDataType eDataType, Object instanceValue) {
+ switch (eDataType.getClassifierID()) {
+ case UsertypePackage.NAME:
+ return convertNameToString(eDataType, instanceValue);
+ default:
+ throw new IllegalArgumentException("The datatype '" + eDataType.getName() + "' is not a valid classifier");
+ }
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public Person createPerson() {
+ PersonImpl person = new PersonImpl();
+ return person;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public Name createNameFromString(EDataType eDataType, String initialValue) {
+ return (Name)super.createFromString(eDataType, initialValue);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public String convertNameToString(EDataType eDataType, Object instanceValue) {
+ return super.convertToString(eDataType, instanceValue);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public UsertypePackage getUsertypePackage() {
+ return (UsertypePackage)getEPackage();
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @deprecated
+ * @generated
+ */
+ public static UsertypePackage getPackage() {
+ return UsertypePackage.eINSTANCE;
+ }
+
+} //UsertypeFactoryImpl
diff --git a/tests/org.eclipse.emf.teneo.hibernate.test/src/org/eclipse/emf/teneo/samples/emf/hibernate/usertype/impl/UsertypePackageImpl.java b/tests/org.eclipse.emf.teneo.hibernate.test/src/org/eclipse/emf/teneo/samples/emf/hibernate/usertype/impl/UsertypePackageImpl.java
new file mode 100644
index 000000000..52f58cb5f
--- /dev/null
+++ b/tests/org.eclipse.emf.teneo.hibernate.test/src/org/eclipse/emf/teneo/samples/emf/hibernate/usertype/impl/UsertypePackageImpl.java
@@ -0,0 +1,315 @@
+/**
+ * <copyright>
+ * </copyright>
+ *
+ * $Id: UsertypePackageImpl.java,v 1.1 2006/07/06 05:10:39 mtaal Exp $
+ */
+package org.eclipse.emf.teneo.samples.emf.hibernate.usertype.impl;
+
+import org.eclipse.emf.ecore.EAttribute;
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.EDataType;
+import org.eclipse.emf.ecore.EPackage;
+import org.eclipse.emf.ecore.EReference;
+
+import org.eclipse.emf.ecore.impl.EPackageImpl;
+
+import org.eclipse.emf.teneo.samples.emf.hibernate.usertype.Name;
+import org.eclipse.emf.teneo.samples.emf.hibernate.usertype.Person;
+import org.eclipse.emf.teneo.samples.emf.hibernate.usertype.UsertypeFactory;
+import org.eclipse.emf.teneo.samples.emf.hibernate.usertype.UsertypePackage;
+
+/**
+ * <!-- begin-user-doc -->
+ * An implementation of the model <b>Package</b>.
+ * <!-- end-user-doc -->
+ * @generated
+ */
+public class UsertypePackageImpl extends EPackageImpl implements UsertypePackage {
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ private EClass personEClass = null;
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ private EDataType nameEDataType = null;
+
+ /**
+ * Creates an instance of the model <b>Package</b>, registered with
+ * {@link org.eclipse.emf.ecore.EPackage.Registry EPackage.Registry} by the package
+ * package URI value.
+ * <p>Note: the correct way to create the package is via the static
+ * factory method {@link #init init()}, which also performs
+ * initialization of the package, or returns the registered package,
+ * if one already exists.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see org.eclipse.emf.ecore.EPackage.Registry
+ * @see org.eclipse.emf.teneo.samples.emf.hibernate.usertype.UsertypePackage#eNS_URI
+ * @see #init()
+ * @generated
+ */
+ private UsertypePackageImpl() {
+ super(eNS_URI, UsertypeFactory.eINSTANCE);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ private static boolean isInited = false;
+
+ /**
+ * Creates, registers, and initializes the <b>Package</b> for this
+ * model, and for any others upon which it depends. Simple
+ * dependencies are satisfied by calling this method on all
+ * dependent packages before doing anything else. This method drives
+ * initialization for interdependent packages directly, in parallel
+ * with this package, itself.
+ * <p>Of this package and its interdependencies, all packages which
+ * have not yet been registered by their URI values are first created
+ * and registered. The packages are then initialized in two steps:
+ * meta-model objects for all of the packages are created before any
+ * are initialized, since one package's meta-model objects may refer to
+ * those of another.
+ * <p>Invocation of this method will not affect any packages that have
+ * already been initialized.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #eNS_URI
+ * @see #createPackageContents()
+ * @see #initializePackageContents()
+ * @generated
+ */
+ public static UsertypePackage init() {
+ if (isInited) return (UsertypePackage)EPackage.Registry.INSTANCE.getEPackage(UsertypePackage.eNS_URI);
+
+ // Obtain or create and register package
+ UsertypePackageImpl theUsertypePackage = (UsertypePackageImpl)(EPackage.Registry.INSTANCE.getEPackage(eNS_URI) instanceof UsertypePackageImpl ? EPackage.Registry.INSTANCE.getEPackage(eNS_URI) : new UsertypePackageImpl());
+
+ isInited = true;
+
+ // Create package meta-data objects
+ theUsertypePackage.createPackageContents();
+
+ // Initialize created meta-data
+ theUsertypePackage.initializePackageContents();
+
+ // Mark meta-data to indicate it can't be changed
+ theUsertypePackage.freeze();
+
+ return theUsertypePackage;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EClass getPerson() {
+ return personEClass;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EAttribute getPerson_Name() {
+ return (EAttribute)personEClass.getEStructuralFeatures().get(0);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EDataType getName_() {
+ return nameEDataType;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public UsertypeFactory getUsertypeFactory() {
+ return (UsertypeFactory)getEFactoryInstance();
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ private boolean isCreated = false;
+
+ /**
+ * Creates the meta-model objects for the package. This method is
+ * guarded to have no affect on any invocation but its first.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void createPackageContents() {
+ if (isCreated) return;
+ isCreated = true;
+
+ // Create classes and their features
+ personEClass = createEClass(PERSON);
+ createEAttribute(personEClass, PERSON__NAME);
+
+ // Create data types
+ nameEDataType = createEDataType(NAME);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ private boolean isInitialized = false;
+
+ /**
+ * Complete the initialization of the package and its meta-model. This
+ * method is guarded to have no affect on any invocation but its first.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void initializePackageContents() {
+ if (isInitialized) return;
+ isInitialized = true;
+
+ // Initialize package
+ setName(eNAME);
+ setNsPrefix(eNS_PREFIX);
+ setNsURI(eNS_URI);
+
+ // Add supertypes to classes
+
+ // Initialize classes and features; add operations and parameters
+ initEClass(personEClass, Person.class, "Person", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
+ initEAttribute(getPerson_Name(), this.getName_(), "name", null, 1, 1, Person.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+
+ // Initialize data types
+ initEDataType(nameEDataType, Name.class, "Name", IS_SERIALIZABLE, !IS_GENERATED_INSTANCE_CLASS);
+
+ // Create resource
+ createResource(eNS_URI);
+
+ // Create annotations
+ // http://hibernate.elver.org/Type
+ createTypeAnnotations();
+ // http://hibernate.elver.org/Columns
+ createColumnsAnnotations();
+ // http://ejb.elver.org/Column/c1
+ createC1Annotations();
+ // http://ejb.elver.org/Column/c2
+ createC2Annotations();
+ // http:///org/eclipse/emf/ecore/util/ExtendedMetaData
+ createExtendedMetaDataAnnotations();
+ }
+
+ /**
+ * Initializes the annotations for <b>http:///org/eclipse/emf/ecore/util/ExtendedMetaData</b>.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected void createExtendedMetaDataAnnotations() {
+ String source = "http:///org/eclipse/emf/ecore/util/ExtendedMetaData";
+ addAnnotation
+ (nameEDataType,
+ source,
+ new String[] {
+ "name", "Name"
+ });
+ addAnnotation
+ (personEClass,
+ source,
+ new String[] {
+ "name", "Person",
+ "kind", "elementOnly"
+ });
+ addAnnotation
+ (getPerson_Name(),
+ source,
+ new String[] {
+ "kind", "element",
+ "name", "name"
+ });
+ }
+
+ /**
+ * Initializes the annotations for <b>http://hibernate.elver.org/Type</b>.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected void createTypeAnnotations() {
+ String source = "http://hibernate.elver.org/Type";
+ addAnnotation
+ (nameEDataType,
+ source,
+ new String[] {
+ "type", "org.eclipse.emf.teneo.samples.emf.hibernate.usertype.NameType"
+ });
+ }
+
+ /**
+ * Initializes the annotations for <b>http://hibernate.elver.org/Columns</b>.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected void createColumnsAnnotations() {
+ String source = "http://hibernate.elver.org/Columns";
+ addAnnotation
+ (nameEDataType,
+ source,
+ new String[] {
+ "value", "c1 c2"
+ });
+ }
+
+ /**
+ * Initializes the annotations for <b>http://ejb.elver.org/Column/c1</b>.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected void createC1Annotations() {
+ String source = "http://ejb.elver.org/Column/c1";
+ addAnnotation
+ (nameEDataType,
+ source,
+ new String[] {
+ "name", "first_name"
+ });
+ }
+
+ /**
+ * Initializes the annotations for <b>http://ejb.elver.org/Column/c2</b>.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected void createC2Annotations() {
+ String source = "http://ejb.elver.org/Column/c2";
+ addAnnotation
+ (nameEDataType,
+ source,
+ new String[] {
+ "name", "last_name"
+ });
+ }
+
+} //UsertypePackageImpl
diff --git a/tests/org.eclipse.emf.teneo.hibernate.test/src/org/eclipse/emf/teneo/samples/emf/hibernate/usertype/model/UserType.genmodel b/tests/org.eclipse.emf.teneo.hibernate.test/src/org/eclipse/emf/teneo/samples/emf/hibernate/usertype/model/UserType.genmodel
new file mode 100644
index 000000000..e36aa0764
--- /dev/null
+++ b/tests/org.eclipse.emf.teneo.hibernate.test/src/org/eclipse/emf/teneo/samples/emf/hibernate/usertype/model/UserType.genmodel
@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<genmodel:GenModel xmi:version="2.0"
+ xmlns:xmi="http://www.omg.org/XMI" xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore"
+ xmlns:genmodel="http://www.eclipse.org/emf/2002/GenModel" modelDirectory="/org.eclipse.emf.teneo.hibernate.test/src"
+ modelPluginID="org.eclipse.emf.teneo.hibernate.test" modelName="UserType" importerID="org.eclipse.xsd.ecore.importer">
+ <foreignModel>UserType.xsd</foreignModel>
+ <genPackages prefix="Usertype" basePackage="org.eclipse.emf.teneo.samples.emf.hibernate" resource="XML"
+ disposableProviderFactory="true" ecorePackage="usertype.ecore#/">
+ <genDataTypes ecoreDataType="usertype.ecore#//Name"/>
+ <genClasses ecoreClass="usertype.ecore#//Person">
+ <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EAttribute usertype.ecore#//Person/name"/>
+ </genClasses>
+ </genPackages>
+</genmodel:GenModel>
diff --git a/tests/org.eclipse.emf.teneo.hibernate.test/src/org/eclipse/emf/teneo/samples/emf/hibernate/usertype/model/UserType.xsd b/tests/org.eclipse.emf.teneo.hibernate.test/src/org/eclipse/emf/teneo/samples/emf/hibernate/usertype/model/UserType.xsd
new file mode 100644
index 000000000..ff81a930a
--- /dev/null
+++ b/tests/org.eclipse.emf.teneo.hibernate.test/src/org/eclipse/emf/teneo/samples/emf/hibernate/usertype/model/UserType.xsd
@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="utf-8"?>
+<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" targetNamespace="http://www.elver.org/samples/emf/hibernate/usertype"
+ xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore" xmlns:this="http://www.elver.org/samples/emf/hibernate/usertype">
+
+ <xsd:simpleType name="Name" ecore:instanceClass="org.eclipse.emf.teneo.samples.emf.hibernate.usertype.Name">
+ <xsd:annotation>
+ <xsd:appinfo source="http://hibernate.elver.org/Type" ecore:key="type">org.eclipse.emf.teneo.samples.emf.hibernate.usertype.NameType</xsd:appinfo>
+ <xsd:appinfo source="http://hibernate.elver.org/Columns" ecore:key="value">c1 c2</xsd:appinfo>
+ <xsd:appinfo source="http://ejb.elver.org/Column/c1" ecore:key="name">first_name</xsd:appinfo>
+ <xsd:appinfo source="http://ejb.elver.org/Column/c2" ecore:key="name">last_name</xsd:appinfo>
+ </xsd:annotation>
+ <xsd:restriction/>
+ </xsd:simpleType>
+
+ <xsd:complexType name="Person">
+ <xsd:sequence>
+ <xsd:element name="name" type="this:Name">
+ </xsd:element>
+ </xsd:sequence>
+ </xsd:complexType>
+
+</xsd:schema> \ No newline at end of file
diff --git a/tests/org.eclipse.emf.teneo.hibernate.test/src/org/eclipse/emf/teneo/samples/emf/hibernate/usertype/model/usertype.ecore b/tests/org.eclipse.emf.teneo.hibernate.test/src/org/eclipse/emf/teneo/samples/emf/hibernate/usertype/model/usertype.ecore
new file mode 100644
index 000000000..e88eb2a94
--- /dev/null
+++ b/tests/org.eclipse.emf.teneo.hibernate.test/src/org/eclipse/emf/teneo/samples/emf/hibernate/usertype/model/usertype.ecore
@@ -0,0 +1,36 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ecore:EPackage xmi:version="2.0"
+ xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore" name="usertype"
+ nsURI="http://www.elver.org/samples/emf/hibernate/usertype" nsPrefix="usertype">
+ <eClassifiers xsi:type="ecore:EDataType" name="Name" instanceClassName="org.eclipse.emf.teneo.samples.emf.hibernate.usertype.Name">
+ <eAnnotations source="http://hibernate.elver.org/Type">
+ <details key="type" value="org.eclipse.emf.teneo.samples.emf.hibernate.usertype.NameType"/>
+ </eAnnotations>
+ <eAnnotations source="http://hibernate.elver.org/Columns">
+ <details key="value" value="c1 c2"/>
+ </eAnnotations>
+ <eAnnotations source="http://ejb.elver.org/Column/c1">
+ <details key="name" value="first_name"/>
+ </eAnnotations>
+ <eAnnotations source="http://ejb.elver.org/Column/c2">
+ <details key="name" value="last_name"/>
+ </eAnnotations>
+ <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
+ <details key="name" value="Name"/>
+ </eAnnotations>
+ </eClassifiers>
+ <eClassifiers xsi:type="ecore:EClass" name="Person">
+ <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
+ <details key="name" value="Person"/>
+ <details key="kind" value="elementOnly"/>
+ </eAnnotations>
+ <eStructuralFeatures xsi:type="ecore:EAttribute" name="name" unique="false" lowerBound="1"
+ eType="#//Name">
+ <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
+ <details key="kind" value="element"/>
+ <details key="name" value="name"/>
+ </eAnnotations>
+ </eStructuralFeatures>
+ </eClassifiers>
+</ecore:EPackage>
diff --git a/tests/org.eclipse.emf.teneo.hibernate.test/src/org/eclipse/emf/teneo/samples/emf/hibernate/usertype/util/UsertypeAdapterFactory.java b/tests/org.eclipse.emf.teneo.hibernate.test/src/org/eclipse/emf/teneo/samples/emf/hibernate/usertype/util/UsertypeAdapterFactory.java
new file mode 100644
index 000000000..4e6ebe220
--- /dev/null
+++ b/tests/org.eclipse.emf.teneo.hibernate.test/src/org/eclipse/emf/teneo/samples/emf/hibernate/usertype/util/UsertypeAdapterFactory.java
@@ -0,0 +1,120 @@
+/**
+ * <copyright>
+ * </copyright>
+ *
+ * $Id: UsertypeAdapterFactory.java,v 1.1 2006/07/06 05:10:38 mtaal Exp $
+ */
+package org.eclipse.emf.teneo.samples.emf.hibernate.usertype.util;
+
+import org.eclipse.emf.common.notify.Adapter;
+import org.eclipse.emf.common.notify.Notifier;
+
+import org.eclipse.emf.common.notify.impl.AdapterFactoryImpl;
+
+import org.eclipse.emf.ecore.EObject;
+
+import org.eclipse.emf.teneo.samples.emf.hibernate.usertype.*;
+
+/**
+ * <!-- begin-user-doc -->
+ * The <b>Adapter Factory</b> for the model.
+ * It provides an adapter <code>createXXX</code> method for each class of the model.
+ * <!-- end-user-doc -->
+ * @see org.eclipse.emf.teneo.samples.emf.hibernate.usertype.UsertypePackage
+ * @generated
+ */
+public class UsertypeAdapterFactory extends AdapterFactoryImpl {
+ /**
+ * The cached model package.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected static UsertypePackage modelPackage;
+
+ /**
+ * Creates an instance of the adapter factory.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public UsertypeAdapterFactory() {
+ if (modelPackage == null) {
+ modelPackage = UsertypePackage.eINSTANCE;
+ }
+ }
+
+ /**
+ * Returns whether this factory is applicable for the type of the object.
+ * <!-- begin-user-doc -->
+ * This implementation returns <code>true</code> if the object is either the model's package or is an instance object of the model.
+ * <!-- end-user-doc -->
+ * @return whether this factory is applicable for the type of the object.
+ * @generated
+ */
+ public boolean isFactoryForType(Object object) {
+ if (object == modelPackage) {
+ return true;
+ }
+ if (object instanceof EObject) {
+ return ((EObject)object).eClass().getEPackage() == modelPackage;
+ }
+ return false;
+ }
+
+ /**
+ * The switch the delegates to the <code>createXXX</code> methods.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected UsertypeSwitch modelSwitch =
+ new UsertypeSwitch() {
+ public Object casePerson(Person object) {
+ return createPersonAdapter();
+ }
+ public Object defaultCase(EObject object) {
+ return createEObjectAdapter();
+ }
+ };
+
+ /**
+ * Creates an adapter for the <code>target</code>.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @param target the object to adapt.
+ * @return the adapter for the <code>target</code>.
+ * @generated
+ */
+ public Adapter createAdapter(Notifier target) {
+ return (Adapter)modelSwitch.doSwitch((EObject)target);
+ }
+
+
+ /**
+ * Creates a new adapter for an object of class '{@link org.eclipse.emf.teneo.samples.emf.hibernate.usertype.Person <em>Person</em>}'.
+ * <!-- begin-user-doc -->
+ * This default implementation returns null so that we can easily ignore cases;
+ * it's useful to ignore a case when inheritance will catch all the cases anyway.
+ * <!-- end-user-doc -->
+ * @return the new adapter.
+ * @see org.eclipse.emf.teneo.samples.emf.hibernate.usertype.Person
+ * @generated
+ */
+ public Adapter createPersonAdapter() {
+ return null;
+ }
+
+ /**
+ * Creates a new adapter for the default case.
+ * <!-- begin-user-doc -->
+ * This default implementation returns null.
+ * <!-- end-user-doc -->
+ * @return the new adapter.
+ * @generated
+ */
+ public Adapter createEObjectAdapter() {
+ return null;
+ }
+
+} //UsertypeAdapterFactory
diff --git a/tests/org.eclipse.emf.teneo.hibernate.test/src/org/eclipse/emf/teneo/samples/emf/hibernate/usertype/util/UsertypeResourceFactoryImpl.java b/tests/org.eclipse.emf.teneo.hibernate.test/src/org/eclipse/emf/teneo/samples/emf/hibernate/usertype/util/UsertypeResourceFactoryImpl.java
new file mode 100644
index 000000000..f03a6c64b
--- /dev/null
+++ b/tests/org.eclipse.emf.teneo.hibernate.test/src/org/eclipse/emf/teneo/samples/emf/hibernate/usertype/util/UsertypeResourceFactoryImpl.java
@@ -0,0 +1,55 @@
+/**
+ * <copyright>
+ * </copyright>
+ *
+ * $Id: UsertypeResourceFactoryImpl.java,v 1.1 2006/07/06 05:10:38 mtaal Exp $
+ */
+package org.eclipse.emf.teneo.samples.emf.hibernate.usertype.util;
+
+import org.eclipse.emf.common.util.URI;
+
+import org.eclipse.emf.ecore.resource.Resource;
+
+import org.eclipse.emf.ecore.resource.impl.ResourceFactoryImpl;
+
+import org.eclipse.emf.ecore.xmi.XMLResource;
+
+/**
+ * <!-- begin-user-doc -->
+ * The <b>Resource Factory</b> associated with the package.
+ * <!-- end-user-doc -->
+ * @see org.eclipse.emf.teneo.samples.emf.hibernate.usertype.util.UsertypeResourceImpl
+ * @generated
+ */
+public class UsertypeResourceFactoryImpl extends ResourceFactoryImpl {
+ /**
+ * Creates an instance of the resource factory.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public UsertypeResourceFactoryImpl() {
+ super();
+ }
+
+ /**
+ * Creates an instance of the resource.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public Resource createResource(URI uri) {
+ XMLResource result = new UsertypeResourceImpl(uri);
+ result.getDefaultSaveOptions().put(XMLResource.OPTION_EXTENDED_META_DATA, Boolean.TRUE);
+ result.getDefaultLoadOptions().put(XMLResource.OPTION_EXTENDED_META_DATA, Boolean.TRUE);
+
+ result.getDefaultSaveOptions().put(XMLResource.OPTION_SCHEMA_LOCATION, Boolean.TRUE);
+
+ result.getDefaultLoadOptions().put(XMLResource.OPTION_USE_ENCODED_ATTRIBUTE_STYLE, Boolean.TRUE);
+ result.getDefaultSaveOptions().put(XMLResource.OPTION_USE_ENCODED_ATTRIBUTE_STYLE, Boolean.TRUE);
+
+ result.getDefaultLoadOptions().put(XMLResource.OPTION_USE_LEXICAL_HANDLER, Boolean.TRUE);
+ return result;
+ }
+
+} //UsertypeResourceFactoryImpl
diff --git a/tests/org.eclipse.emf.teneo.hibernate.test/src/org/eclipse/emf/teneo/samples/emf/hibernate/usertype/util/UsertypeResourceImpl.java b/tests/org.eclipse.emf.teneo.hibernate.test/src/org/eclipse/emf/teneo/samples/emf/hibernate/usertype/util/UsertypeResourceImpl.java
new file mode 100644
index 000000000..c06184b9f
--- /dev/null
+++ b/tests/org.eclipse.emf.teneo.hibernate.test/src/org/eclipse/emf/teneo/samples/emf/hibernate/usertype/util/UsertypeResourceImpl.java
@@ -0,0 +1,32 @@
+/**
+ * <copyright>
+ * </copyright>
+ *
+ * $Id: UsertypeResourceImpl.java,v 1.1 2006/07/06 05:10:38 mtaal Exp $
+ */
+package org.eclipse.emf.teneo.samples.emf.hibernate.usertype.util;
+
+import org.eclipse.emf.common.util.URI;
+
+import org.eclipse.emf.ecore.xmi.impl.XMLResourceImpl;
+
+/**
+ * <!-- begin-user-doc -->
+ * The <b>Resource </b> associated with the package.
+ * <!-- end-user-doc -->
+ * @see org.eclipse.emf.teneo.samples.emf.hibernate.usertype.util.UsertypeResourceFactoryImpl
+ * @generated
+ */
+public class UsertypeResourceImpl extends XMLResourceImpl {
+ /**
+ * Creates an instance of the resource.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @param uri the URI of the new resource.
+ * @generated
+ */
+ public UsertypeResourceImpl(URI uri) {
+ super(uri);
+ }
+
+} //UsertypeResourceImpl
diff --git a/tests/org.eclipse.emf.teneo.hibernate.test/src/org/eclipse/emf/teneo/samples/emf/hibernate/usertype/util/UsertypeSwitch.java b/tests/org.eclipse.emf.teneo.hibernate.test/src/org/eclipse/emf/teneo/samples/emf/hibernate/usertype/util/UsertypeSwitch.java
new file mode 100644
index 000000000..5e09a98ec
--- /dev/null
+++ b/tests/org.eclipse.emf.teneo.hibernate.test/src/org/eclipse/emf/teneo/samples/emf/hibernate/usertype/util/UsertypeSwitch.java
@@ -0,0 +1,130 @@
+/**
+ * <copyright>
+ * </copyright>
+ *
+ * $Id: UsertypeSwitch.java,v 1.1 2006/07/06 05:10:38 mtaal Exp $
+ */
+package org.eclipse.emf.teneo.samples.emf.hibernate.usertype.util;
+
+import java.util.List;
+
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.EObject;
+
+import org.eclipse.emf.teneo.samples.emf.hibernate.usertype.*;
+
+/**
+ * <!-- begin-user-doc -->
+ * The <b>Switch</b> for the model's inheritance hierarchy.
+ * It supports the call {@link #doSwitch(EObject) doSwitch(object)}
+ * to invoke the <code>caseXXX</code> method for each class of the model,
+ * starting with the actual class of the object
+ * and proceeding up the inheritance hierarchy
+ * until a non-null result is returned,
+ * which is the result of the switch.
+ * <!-- end-user-doc -->
+ * @see org.eclipse.emf.teneo.samples.emf.hibernate.usertype.UsertypePackage
+ * @generated
+ */
+public class UsertypeSwitch {
+ /**
+ * The cached model package
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected static UsertypePackage modelPackage;
+
+ /**
+ * Creates an instance of the switch.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public UsertypeSwitch() {
+ if (modelPackage == null) {
+ modelPackage = UsertypePackage.eINSTANCE;
+ }
+ }
+
+ /**
+ * Calls <code>caseXXX</code> for each class of the model until one returns a non null result; it yields that result.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the first non-null result returned by a <code>caseXXX</code> call.
+ * @generated
+ */
+ public Object doSwitch(EObject theEObject) {
+ return doSwitch(theEObject.eClass(), theEObject);
+ }
+
+ /**
+ * Calls <code>caseXXX</code> for each class of the model until one returns a non null result; it yields that result.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the first non-null result returned by a <code>caseXXX</code> call.
+ * @generated
+ */
+ protected Object doSwitch(EClass theEClass, EObject theEObject) {
+ if (theEClass.eContainer() == modelPackage) {
+ return doSwitch(theEClass.getClassifierID(), theEObject);
+ }
+ else {
+ List eSuperTypes = theEClass.getESuperTypes();
+ return
+ eSuperTypes.isEmpty() ?
+ defaultCase(theEObject) :
+ doSwitch((EClass)eSuperTypes.get(0), theEObject);
+ }
+ }
+
+ /**
+ * Calls <code>caseXXX</code> for each class of the model until one returns a non null result; it yields that result.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the first non-null result returned by a <code>caseXXX</code> call.
+ * @generated
+ */
+ protected Object doSwitch(int classifierID, EObject theEObject) {
+ switch (classifierID) {
+ case UsertypePackage.PERSON: {
+ Person person = (Person)theEObject;
+ Object result = casePerson(person);
+ if (result == null) result = defaultCase(theEObject);
+ return result;
+ }
+ default: return defaultCase(theEObject);
+ }
+ }
+
+ /**
+ * Returns the result of interpretting the object as an instance of '<em>Person</em>'.
+ * <!-- begin-user-doc -->
+ * This implementation returns null;
+ * returning a non-null result will terminate the switch.
+ * <!-- end-user-doc -->
+ * @param object the target of the switch.
+ * @return the result of interpretting the object as an instance of '<em>Person</em>'.
+ * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
+ * @generated
+ */
+ public Object casePerson(Person object) {
+ return null;
+ }
+
+ /**
+ * Returns the result of interpretting the object as an instance of '<em>EObject</em>'.
+ * <!-- begin-user-doc -->
+ * This implementation returns null;
+ * returning a non-null result will terminate the switch, but this is the last case anyway.
+ * <!-- end-user-doc -->
+ * @param object the target of the switch.
+ * @return the result of interpretting the object as an instance of '<em>EObject</em>'.
+ * @see #doSwitch(org.eclipse.emf.ecore.EObject)
+ * @generated
+ */
+ public Object defaultCase(EObject object) {
+ return null;
+ }
+
+} //UsertypeSwitch
diff --git a/tests/org.eclipse.emf.teneo.hibernate.test/src/org/eclipse/emf/teneo/samples/emf/hibernate/usertype/util/UsertypeXMLProcessor.java b/tests/org.eclipse.emf.teneo.hibernate.test/src/org/eclipse/emf/teneo/samples/emf/hibernate/usertype/util/UsertypeXMLProcessor.java
new file mode 100644
index 000000000..ae0fee98f
--- /dev/null
+++ b/tests/org.eclipse.emf.teneo.hibernate.test/src/org/eclipse/emf/teneo/samples/emf/hibernate/usertype/util/UsertypeXMLProcessor.java
@@ -0,0 +1,50 @@
+/**
+ * <copyright>
+ * </copyright>
+ *
+ * $Id: UsertypeXMLProcessor.java,v 1.1 2006/07/06 05:10:38 mtaal Exp $
+ */
+package org.eclipse.emf.teneo.samples.emf.hibernate.usertype.util;
+
+import java.util.Map;
+
+import org.eclipse.emf.ecore.EPackage;
+
+import org.eclipse.emf.ecore.xmi.util.XMLProcessor;
+
+import org.eclipse.emf.teneo.samples.emf.hibernate.usertype.UsertypePackage;
+
+/**
+ * This class contains helper methods to serialize and deserialize XML documents
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+public class UsertypeXMLProcessor extends XMLProcessor {
+ /**
+ * Public constructor to instantiate the helper.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public UsertypeXMLProcessor() {
+ super((EPackage.Registry.INSTANCE));
+ UsertypePackage.eINSTANCE.eClass();
+ }
+
+ /**
+ * Register for "*" and "xml" file extensions the UsertypeResourceFactoryImpl factory.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected Map getRegistrations() {
+ if (registrations == null) {
+ super.getRegistrations();
+ registrations.put(XML_EXTENSION, new UsertypeResourceFactoryImpl());
+ registrations.put(STAR_EXTENSION, new UsertypeResourceFactoryImpl());
+ }
+ return registrations;
+ }
+
+} //UsertypeXMLProcessor
diff --git a/tests/org.eclipse.emf.teneo.hibernate.test/src/test.properties b/tests/org.eclipse.emf.teneo.hibernate.test/src/test.properties
new file mode 100644
index 000000000..8f9b9f2c7
--- /dev/null
+++ b/tests/org.eclipse.emf.teneo.hibernate.test/src/test.properties
@@ -0,0 +1,29 @@
+# <cfgname>.dbadapter= name of a dbadapter (see dbadapters.properties)
+# <cfgname>.mapstrategy= mapping strategy, either SINGLE_TABLE or JOINED
+# <cfgname>.optimistic= optimistic setting, either true or false
+
+
+mysql_a_o.dbadapter=mysql
+mysql_a_o.mapstrategy=SINGLE_TABLE
+mysql_a_o.optimistic=true
+
+mysql_s_o.dbadapter=mysql
+mysql_s_o.mapstrategy=JOINED
+mysql_s_o.optimistic=true
+
+#pgsql_a_o.dbadapter=pgsql
+#pgsql_a_o.mapstrategy=SINGLE_TABLE
+#pgsql_a_o.optimistic=true
+
+#pgsql_s_o.dbadapter=pgsql
+#pgsql_s_o.mapstrategy=JOINED
+#pgsql_s_o.optimistic=true
+
+#mssql_a_o.dbadapter=mcssql
+#mssql_a_o.mapstrategy=SINGLE_TABLE
+#mssql_a_o.optimistic=true
+
+#mssql_s_o.dbadapter=mcssql
+#mssql_s_o.mapstrategy=JOINED
+#mssql_s_o.optimistic=true
+

Back to the top