Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormtaal2008-03-30 16:54:58 -0400
committermtaal2008-03-30 16:54:58 -0400
commit1e8a665352e135d9220630b1261dec7925a02dd3 (patch)
tree2f06a27c36c5fe38d9158e2de158a53fb78cee09
parentf29dd0a0fa669a7da744f7f62c52ff590c0a6bef (diff)
downloadorg.eclipse.emf.teneo-1e8a665352e135d9220630b1261dec7925a02dd3.tar.gz
org.eclipse.emf.teneo-1e8a665352e135d9220630b1261dec7925a02dd3.tar.xz
org.eclipse.emf.teneo-1e8a665352e135d9220630b1261dec7925a02dd3.zip
[224790]
-rw-r--r--tests/org.eclipse.emf.teneo.hibernate.test/hbm/org.eclipse.emf.teneo.hibernate.test.emf.annotations/UserTypeAction_mysql_a_o_hibernate.hbm.xml5
-rw-r--r--tests/org.eclipse.emf.teneo.hibernate.test/hbm/org.eclipse.emf.teneo.hibernate.test.emf.annotations/UserTypeAction_mysql_e_o_hibernate.hbm.xml5
-rw-r--r--tests/org.eclipse.emf.teneo.hibernate.test/hbm/org.eclipse.emf.teneo.hibernate.test.emf.annotations/UserTypeAction_mysql_s_o_hibernate.hbm.xml5
-rw-r--r--tests/org.eclipse.emf.teneo.hibernate.test/src/org/eclipse/emf/teneo/hibernate/test/emf/annotations/AllTests.java6
-rw-r--r--tests/org.eclipse.emf.teneo.hibernate.test/src/org/eclipse/emf/teneo/hibernate/test/emf/annotations/UserTypeAction.java16
-rw-r--r--tests/org.eclipse.emf.teneo.hibernate.test/src/org/eclipse/emf/teneo/samples/emf/hibernate/usertype/Person.java32
-rw-r--r--tests/org.eclipse.emf.teneo.hibernate.test/src/org/eclipse/emf/teneo/samples/emf/hibernate/usertype/UsertypePackage.java37
-rw-r--r--tests/org.eclipse.emf.teneo.hibernate.test/src/org/eclipse/emf/teneo/samples/emf/hibernate/usertype/impl/AddressImpl.java4
-rw-r--r--tests/org.eclipse.emf.teneo.hibernate.test/src/org/eclipse/emf/teneo/samples/emf/hibernate/usertype/impl/PersonImpl.java60
-rw-r--r--tests/org.eclipse.emf.teneo.hibernate.test/src/org/eclipse/emf/teneo/samples/emf/hibernate/usertype/impl/UsertypePackageImpl.java49
-rw-r--r--tests/org.eclipse.emf.teneo.hibernate.test/src/org/eclipse/emf/teneo/samples/emf/hibernate/usertype/model/UserType.genmodel1
-rw-r--r--tests/org.eclipse.emf.teneo.hibernate.test/src/org/eclipse/emf/teneo/samples/emf/hibernate/usertype/model/usertype.ecore8
-rw-r--r--tests/org.eclipse.emf.teneo.hibernate.test/src/org/eclipse/emf/teneo/samples/emf/hibernate/usertype/util/UsertypeAdapterFactory.java4
-rw-r--r--tests/org.eclipse.emf.teneo.hibernate.test/src/org/eclipse/emf/teneo/samples/emf/hibernate/usertype/util/UsertypeSwitch.java14
14 files changed, 214 insertions, 32 deletions
diff --git a/tests/org.eclipse.emf.teneo.hibernate.test/hbm/org.eclipse.emf.teneo.hibernate.test.emf.annotations/UserTypeAction_mysql_a_o_hibernate.hbm.xml b/tests/org.eclipse.emf.teneo.hibernate.test/hbm/org.eclipse.emf.teneo.hibernate.test.emf.annotations/UserTypeAction_mysql_a_o_hibernate.hbm.xml
index 56f083a3f..8c43d0351 100644
--- a/tests/org.eclipse.emf.teneo.hibernate.test/hbm/org.eclipse.emf.teneo.hibernate.test.emf.annotations/UserTypeAction_mysql_a_o_hibernate.hbm.xml
+++ b/tests/org.eclipse.emf.teneo.hibernate.test/hbm/org.eclipse.emf.teneo.hibernate.test.emf.annotations/UserTypeAction_mysql_a_o_hibernate.hbm.xml
@@ -45,6 +45,9 @@
</key>
<one-to-many entity-name="Address"/>
</bag>
+ <property name="birthPlace" lazy="false" insert="true" update="true" not-null="true" unique="false" type="java.lang.String">
+ <column not-null="true" unique="false" name="`birthplace`"/>
+ </property>
</class>
<class name="org.eclipse.emf.teneo.samples.emf.hibernate.usertype.impl.AddressImpl" entity-name="Address" abstract="false" lazy="false" discriminator-value="Address" table="`address`">
<meta attribute="eclassName">Address</meta>
@@ -64,4 +67,6 @@
<column not-null="false" unique="false" name="`address_person_e_id`"/>
</many-to-one>
</class>
+ <query name="getPersonByBirthPlace2"><![CDATA[select p from Person p where p.birthPlace=?]]></query>
+ <query name="getPersonByBirthPlace"><![CDATA[select p from Person p where p.birthPlace=?]]></query>
</hibernate-mapping> \ No newline at end of file
diff --git a/tests/org.eclipse.emf.teneo.hibernate.test/hbm/org.eclipse.emf.teneo.hibernate.test.emf.annotations/UserTypeAction_mysql_e_o_hibernate.hbm.xml b/tests/org.eclipse.emf.teneo.hibernate.test/hbm/org.eclipse.emf.teneo.hibernate.test.emf.annotations/UserTypeAction_mysql_e_o_hibernate.hbm.xml
index 34462d550..6dea74a74 100644
--- a/tests/org.eclipse.emf.teneo.hibernate.test/hbm/org.eclipse.emf.teneo.hibernate.test.emf.annotations/UserTypeAction_mysql_e_o_hibernate.hbm.xml
+++ b/tests/org.eclipse.emf.teneo.hibernate.test/hbm/org.eclipse.emf.teneo.hibernate.test.emf.annotations/UserTypeAction_mysql_e_o_hibernate.hbm.xml
@@ -44,6 +44,9 @@
</key>
<one-to-many entity-name="Address"/>
</bag>
+ <property name="birthPlace" lazy="false" insert="true" update="true" not-null="true" unique="false" type="java.lang.String">
+ <column not-null="true" unique="false" name="`birthplace`"/>
+ </property>
</class>
<class name="org.eclipse.emf.teneo.samples.emf.hibernate.usertype.impl.AddressImpl" entity-name="Address" abstract="false" lazy="false" table="`address`">
<meta attribute="eclassName">Address</meta>
@@ -62,4 +65,6 @@
<column not-null="false" unique="false" name="`address_person_e_id`"/>
</many-to-one>
</class>
+ <query name="getPersonByBirthPlace2"><![CDATA[select p from Person p where p.birthPlace=?]]></query>
+ <query name="getPersonByBirthPlace"><![CDATA[select p from Person p where p.birthPlace=?]]></query>
</hibernate-mapping> \ No newline at end of file
diff --git a/tests/org.eclipse.emf.teneo.hibernate.test/hbm/org.eclipse.emf.teneo.hibernate.test.emf.annotations/UserTypeAction_mysql_s_o_hibernate.hbm.xml b/tests/org.eclipse.emf.teneo.hibernate.test/hbm/org.eclipse.emf.teneo.hibernate.test.emf.annotations/UserTypeAction_mysql_s_o_hibernate.hbm.xml
index 34462d550..6dea74a74 100644
--- a/tests/org.eclipse.emf.teneo.hibernate.test/hbm/org.eclipse.emf.teneo.hibernate.test.emf.annotations/UserTypeAction_mysql_s_o_hibernate.hbm.xml
+++ b/tests/org.eclipse.emf.teneo.hibernate.test/hbm/org.eclipse.emf.teneo.hibernate.test.emf.annotations/UserTypeAction_mysql_s_o_hibernate.hbm.xml
@@ -44,6 +44,9 @@
</key>
<one-to-many entity-name="Address"/>
</bag>
+ <property name="birthPlace" lazy="false" insert="true" update="true" not-null="true" unique="false" type="java.lang.String">
+ <column not-null="true" unique="false" name="`birthplace`"/>
+ </property>
</class>
<class name="org.eclipse.emf.teneo.samples.emf.hibernate.usertype.impl.AddressImpl" entity-name="Address" abstract="false" lazy="false" table="`address`">
<meta attribute="eclassName">Address</meta>
@@ -62,4 +65,6 @@
<column not-null="false" unique="false" name="`address_person_e_id`"/>
</many-to-one>
</class>
+ <query name="getPersonByBirthPlace2"><![CDATA[select p from Person p where p.birthPlace=?]]></query>
+ <query name="getPersonByBirthPlace"><![CDATA[select p from Person p where p.birthPlace=?]]></query>
</hibernate-mapping> \ No newline at end of file
diff --git a/tests/org.eclipse.emf.teneo.hibernate.test/src/org/eclipse/emf/teneo/hibernate/test/emf/annotations/AllTests.java b/tests/org.eclipse.emf.teneo.hibernate.test/src/org/eclipse/emf/teneo/hibernate/test/emf/annotations/AllTests.java
index 7d02e846e..9a7173e8c 100644
--- 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
@@ -48,7 +48,7 @@ import org.eclipse.emf.teneo.test.emf.annotations.UniqueConstraintsAction;
* All tests
*
* @author <a href="mailto:mtaal@elver.org">Martin Taal</a>
- * @version $Revision: 1.53 $
+ * @version $Revision: 1.54 $
*/
public class AllTests {
@@ -57,6 +57,8 @@ public class AllTests {
new MultiCfgTestSuite("Test for org.eclipse.emf.teneo.hibernate.test.emf.annotations", HibernateTestbed
.instance().getConfigurations());
+ suite.addTestSuite(UserTypeAction.class);
+
suite.addTestSuite(InheritanceAnnotationAction.class);
suite.addTestSuite(CascadeNotallAction.class);
suite.addTestSuite(IdAction.class);
@@ -69,8 +71,6 @@ public class AllTests {
suite.addTestSuite(ManyToManyAction.class);
- suite.addTestSuite(UserTypeAction.class);
-
suite.addTestSuite(EmbeddedAction.class);
suite.addTestSuite(HbIdAction.class);
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
index 966ac88a4..ef1580401 100644
--- 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
@@ -11,7 +11,7 @@
* L.M. Fridael
* </copyright>
*
- * $Id: UserTypeAction.java,v 1.9 2008/02/28 07:08:57 mtaal Exp $
+ * $Id: UserTypeAction.java,v 1.10 2008/03/30 20:54:58 mtaal Exp $
*/
package org.eclipse.emf.teneo.hibernate.test.emf.annotations;
@@ -22,6 +22,7 @@ import java.sql.SQLException;
import java.sql.Statement;
import java.util.List;
+import org.eclipse.emf.teneo.hibernate.test.stores.HibernateTestStore;
import org.eclipse.emf.teneo.samples.emf.hibernate.usertype.Address;
import org.eclipse.emf.teneo.samples.emf.hibernate.usertype.Name;
import org.eclipse.emf.teneo.samples.emf.hibernate.usertype.Person;
@@ -30,12 +31,13 @@ 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;
+import org.hibernate.Query;
/**
* Test
*
* @author <a href="mailto:lmfridael@elver.org">Laurens Fridael</a>
- * @version $Revision: 1.9 $
+ * @version $Revision: 1.10 $
*/
@SuppressWarnings("unchecked")
public class UserTypeAction extends AbstractTestAction {
@@ -73,6 +75,7 @@ public class UserTypeAction extends AbstractTestAction {
addr2.setAddressInfo("addr2");
person.getAddresses().add(addr1);
person.getAddresses().add(addr2);
+ person.setBirthPlace("Singapore");
store.store(addr1);
store.store(addr2);
store.store(person);
@@ -96,6 +99,15 @@ public class UserTypeAction extends AbstractTestAction {
assertEquals(2, person.getAddresses().size());
store.commitTransaction();
+
+ final Query q1 = ((HibernateTestStore) store).getSession().getNamedQuery("getPersonByBirthPlace");
+ q1.setString(0, "Singapore");
+ assertEquals(1, q1.list().size());
+
+ final Query q2 = ((HibernateTestStore) store).getSession().getNamedQuery("getPersonByBirthPlace2");
+ q2.setString(0, "Singapore");
+ assertEquals(1, q2.list().size());
+
}
private void testDatabase(TestStore store) {
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
index b2aea6d97..7de05dc99 100644
--- 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
@@ -2,7 +2,7 @@
* <copyright>
* </copyright>
*
- * $Id: Person.java,v 1.5 2007/03/04 21:18:27 mtaal Exp $
+ * $Id: Person.java,v 1.6 2008/03/30 20:54:58 mtaal Exp $
*/
package org.eclipse.emf.teneo.samples.emf.hibernate.usertype;
@@ -23,11 +23,13 @@ import org.eclipse.emf.ecore.EObject;
* <li>{@link org.eclipse.emf.teneo.samples.emf.hibernate.usertype.Person#getPhoneNumbers <em>Phone Numbers</em>}</li>
* <li>{@link org.eclipse.emf.teneo.samples.emf.hibernate.usertype.Person#getEmergencyContact <em>Emergency Contact</em>}</li>
* <li>{@link org.eclipse.emf.teneo.samples.emf.hibernate.usertype.Person#getAddresses <em>Addresses</em>}</li>
+ * <li>{@link org.eclipse.emf.teneo.samples.emf.hibernate.usertype.Person#getBirthPlace <em>Birth Place</em>}</li>
* </ul>
* </p>
*
* @see org.eclipse.emf.teneo.samples.emf.hibernate.usertype.UsertypePackage#getPerson()
* @model extendedMetaData="name='Person' kind='elementOnly'"
+ * annotation="teneo.hibernate appinfo='\t\t\t\t\t\t@NamedQuery(name=\"getPersonByBirthPlace\" query=\"select p from Person p where p.birthPlace=?\")'"
* @generated
*/
public interface Person extends EObject {
@@ -96,7 +98,7 @@ public interface Person extends EObject {
* <!-- end-user-doc -->
* @return the value of the '<em>Phone Numbers</em>' attribute list.
* @see org.eclipse.emf.teneo.samples.emf.hibernate.usertype.UsertypePackage#getPerson_PhoneNumbers()
- * @model type="org.eclipse.emf.teneo.samples.emf.hibernate.usertype.UsaPhoneNumber" dataType="org.eclipse.emf.teneo.samples.emf.hibernate.usertype.PhoneNumber" upper="100"
+ * @model dataType="org.eclipse.emf.teneo.samples.emf.hibernate.usertype.PhoneNumber" upper="100"
* @generated
*/
EList getPhoneNumbers();
@@ -147,4 +149,30 @@ public interface Person extends EObject {
*/
EList getAddresses();
+ /**
+ * Returns the value of the '<em><b>Birth Place</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>Birth Place</em>' attribute isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ * @return the value of the '<em>Birth Place</em>' attribute.
+ * @see #setBirthPlace(String)
+ * @see org.eclipse.emf.teneo.samples.emf.hibernate.usertype.UsertypePackage#getPerson_BirthPlace()
+ * @model required="true"
+ * @generated
+ */
+ String getBirthPlace();
+
+ /**
+ * Sets the value of the '{@link org.eclipse.emf.teneo.samples.emf.hibernate.usertype.Person#getBirthPlace <em>Birth Place</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @param value the new value of the '<em>Birth Place</em>' attribute.
+ * @see #getBirthPlace()
+ * @generated
+ */
+ void setBirthPlace(String 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/UsertypePackage.java b/tests/org.eclipse.emf.teneo.hibernate.test/src/org/eclipse/emf/teneo/samples/emf/hibernate/usertype/UsertypePackage.java
index cab5885be..0d8e7e56d 100644
--- 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
@@ -2,7 +2,7 @@
* <copyright>
* </copyright>
*
- * $Id: UsertypePackage.java,v 1.8 2007/03/04 21:18:27 mtaal Exp $
+ * $Id: UsertypePackage.java,v 1.9 2008/03/30 20:54:58 mtaal Exp $
*/
package org.eclipse.emf.teneo.samples.emf.hibernate.usertype;
@@ -25,6 +25,7 @@ import org.eclipse.emf.ecore.EReference;
* <!-- end-user-doc -->
* @see org.eclipse.emf.teneo.samples.emf.hibernate.usertype.UsertypeFactory
* @model kind="package"
+ * annotation="teneo.hibernate appinfo='\t\t\t\t\t\t@NamedQuery(name=\"getPersonByBirthPlace2\" query=\"select p from Person p where p.birthPlace=?\")\n\t\t\t\t\t'"
* @generated
*/
public interface UsertypePackage extends EPackage {
@@ -116,13 +117,22 @@ public interface UsertypePackage extends EPackage {
int PERSON__ADDRESSES = 4;
/**
+ * The feature id for the '<em><b>Birth Place</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int PERSON__BIRTH_PLACE = 5;
+
+ /**
* The number of structural features of the '<em>Person</em>' class.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
- int PERSON_FEATURE_COUNT = 5;
+ int PERSON_FEATURE_COUNT = 6;
/**
* The meta object id for the '{@link org.eclipse.emf.teneo.samples.emf.hibernate.usertype.impl.AddressImpl <em>Address</em>}' class.
@@ -259,6 +269,17 @@ public interface UsertypePackage extends EPackage {
EReference getPerson_Addresses();
/**
+ * Returns the meta object for the attribute '{@link org.eclipse.emf.teneo.samples.emf.hibernate.usertype.Person#getBirthPlace <em>Birth Place</em>}'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the meta object for the attribute '<em>Birth Place</em>'.
+ * @see org.eclipse.emf.teneo.samples.emf.hibernate.usertype.Person#getBirthPlace()
+ * @see #getPerson()
+ * @generated
+ */
+ EAttribute getPerson_BirthPlace();
+
+ /**
* Returns the meta object for class '{@link org.eclipse.emf.teneo.samples.emf.hibernate.usertype.Address <em>Address</em>}'.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
@@ -298,7 +319,7 @@ public interface UsertypePackage extends EPackage {
* @see org.eclipse.emf.teneo.samples.emf.hibernate.usertype.Name
* @model instanceClass="org.eclipse.emf.teneo.samples.emf.hibernate.usertype.Name"
* annotation="teneo.jpa appinfo='\n\t\t\t\t\t\t@TypeDef(name=\"nameType\" typeClass=\"org.eclipse.emf.teneo.samples.emf.hibernate.usertype.NameType\")\n\t\t\t\t\t\t@Columns({@Column(name=\"first_name\"), @Column(name=\"last_name\")})\n\t\t\t\t\t'"
- * extendedMetaData="name='Name'"
+ * extendedMetaData="name='Name'"
* @generated
*/
EDataType getName_();
@@ -321,7 +342,7 @@ public interface UsertypePackage extends EPackage {
* @return the meta object for data type '<em>Int Array</em>'.
* @model instanceClass="int[]"
* extendedMetaData="name='IntArray'"
- * annotation="teneo.jpa appinfo='\n\t\t\t\t\t\t@TypeDef(name=\"intArrayType\" typeClass=\"org.eclipse.emf.teneo.hibernate.mapping.DefaultToStringUserType\", parameters={@Parameter(name=\"epackage\" value=\"http://www.elver.org/samples/emf/hibernate/usertype\"), @Parameter(name=\"edatatype\", value=\"IntArray\")})\n\t\t\t\t\t'"
+ * annotation="teneo.jpa appinfo='\n\t\t\t\t\t\t@TypeDef(name=\"intArrayType\" typeClass=\"org.eclipse.emf.teneo.hibernate.mapping.DefaultToStringUserType\", parameters={@Parameter(name=\"epackage\" value=\"http://www.elver.org/samples/emf/hibernate/usertype\"), @Parameter(name=\"edatatype\", value=\"IntArray\")})\n\t\t\t\t\t'"
* @generated
*/
EDataType getIntArray();
@@ -399,6 +420,14 @@ public interface UsertypePackage extends EPackage {
EReference PERSON__ADDRESSES = eINSTANCE.getPerson_Addresses();
/**
+ * The meta object literal for the '<em><b>Birth Place</b></em>' attribute feature.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ EAttribute PERSON__BIRTH_PLACE = eINSTANCE.getPerson_BirthPlace();
+
+ /**
* The meta object literal for the '{@link org.eclipse.emf.teneo.samples.emf.hibernate.usertype.impl.AddressImpl <em>Address</em>}' class.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
diff --git a/tests/org.eclipse.emf.teneo.hibernate.test/src/org/eclipse/emf/teneo/samples/emf/hibernate/usertype/impl/AddressImpl.java b/tests/org.eclipse.emf.teneo.hibernate.test/src/org/eclipse/emf/teneo/samples/emf/hibernate/usertype/impl/AddressImpl.java
index b1f6ec615..b444d69e8 100644
--- a/tests/org.eclipse.emf.teneo.hibernate.test/src/org/eclipse/emf/teneo/samples/emf/hibernate/usertype/impl/AddressImpl.java
+++ b/tests/org.eclipse.emf.teneo.hibernate.test/src/org/eclipse/emf/teneo/samples/emf/hibernate/usertype/impl/AddressImpl.java
@@ -2,7 +2,7 @@
* <copyright>
* </copyright>
*
- * $Id: AddressImpl.java,v 1.1 2007/03/04 21:18:27 mtaal Exp $
+ * $Id: AddressImpl.java,v 1.2 2008/03/30 20:54:58 mtaal Exp $
*/
package org.eclipse.emf.teneo.samples.emf.hibernate.usertype.impl;
@@ -62,7 +62,7 @@ public class AddressImpl extends EObjectImpl implements Address {
* @generated
* @ordered
*/
- protected Person person = null;
+ protected Person person;
/**
* <!-- begin-user-doc -->
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
index 515d22484..f464e514b 100644
--- 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
@@ -2,7 +2,7 @@
* <copyright>
* </copyright>
*
- * $Id: PersonImpl.java,v 1.8 2007/03/04 21:18:27 mtaal Exp $
+ * $Id: PersonImpl.java,v 1.9 2008/03/30 20:54:58 mtaal Exp $
*/
package org.eclipse.emf.teneo.samples.emf.hibernate.usertype.impl;
@@ -43,6 +43,7 @@ import org.eclipse.emf.teneo.samples.emf.hibernate.usertype.UsertypePackage;
* <li>{@link org.eclipse.emf.teneo.samples.emf.hibernate.usertype.impl.PersonImpl#getPhoneNumbers <em>Phone Numbers</em>}</li>
* <li>{@link org.eclipse.emf.teneo.samples.emf.hibernate.usertype.impl.PersonImpl#getEmergencyContact <em>Emergency Contact</em>}</li>
* <li>{@link org.eclipse.emf.teneo.samples.emf.hibernate.usertype.impl.PersonImpl#getAddresses <em>Addresses</em>}</li>
+ * <li>{@link org.eclipse.emf.teneo.samples.emf.hibernate.usertype.impl.PersonImpl#getBirthPlace <em>Birth Place</em>}</li>
* </ul>
* </p>
*
@@ -97,7 +98,7 @@ public class PersonImpl extends EObjectImpl implements Person {
* @generated
* @ordered
*/
- protected EList phoneNumbers = null;
+ protected EList phoneNumbers;
/**
* The default value of the '{@link #getEmergencyContact() <em>Emergency Contact</em>}' attribute.
@@ -127,7 +128,27 @@ public class PersonImpl extends EObjectImpl implements Person {
* @generated
* @ordered
*/
- protected EList addresses = null;
+ protected EList addresses;
+
+ /**
+ * The default value of the '{@link #getBirthPlace() <em>Birth Place</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getBirthPlace()
+ * @generated
+ * @ordered
+ */
+ protected static final String BIRTH_PLACE_EDEFAULT = null;
+
+ /**
+ * The cached value of the '{@link #getBirthPlace() <em>Birth Place</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getBirthPlace()
+ * @generated
+ * @ordered
+ */
+ protected String birthPlace = BIRTH_PLACE_EDEFAULT;
/**
* <!-- begin-user-doc -->
@@ -239,6 +260,27 @@ public class PersonImpl extends EObjectImpl implements Person {
* <!-- end-user-doc -->
* @generated
*/
+ public String getBirthPlace() {
+ return birthPlace;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void setBirthPlace(String newBirthPlace) {
+ String oldBirthPlace = birthPlace;
+ birthPlace = newBirthPlace;
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.SET, UsertypePackage.PERSON__BIRTH_PLACE, oldBirthPlace, birthPlace));
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
public NotificationChain eInverseAdd(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
switch (featureID) {
case UsertypePackage.PERSON__ADDRESSES:
@@ -277,6 +319,8 @@ public class PersonImpl extends EObjectImpl implements Person {
return getEmergencyContact();
case UsertypePackage.PERSON__ADDRESSES:
return getAddresses();
+ case UsertypePackage.PERSON__BIRTH_PLACE:
+ return getBirthPlace();
}
return super.eGet(featureID, resolve, coreType);
}
@@ -305,6 +349,9 @@ public class PersonImpl extends EObjectImpl implements Person {
getAddresses().clear();
getAddresses().addAll((Collection)newValue);
return;
+ case UsertypePackage.PERSON__BIRTH_PLACE:
+ setBirthPlace((String)newValue);
+ return;
}
super.eSet(featureID, newValue);
}
@@ -331,6 +378,9 @@ public class PersonImpl extends EObjectImpl implements Person {
case UsertypePackage.PERSON__ADDRESSES:
getAddresses().clear();
return;
+ case UsertypePackage.PERSON__BIRTH_PLACE:
+ setBirthPlace(BIRTH_PLACE_EDEFAULT);
+ return;
}
super.eUnset(featureID);
}
@@ -352,6 +402,8 @@ public class PersonImpl extends EObjectImpl implements Person {
return EMERGENCY_CONTACT_EDEFAULT == null ? emergencyContact != null : !EMERGENCY_CONTACT_EDEFAULT.equals(emergencyContact);
case UsertypePackage.PERSON__ADDRESSES:
return addresses != null && !addresses.isEmpty();
+ case UsertypePackage.PERSON__BIRTH_PLACE:
+ return BIRTH_PLACE_EDEFAULT == null ? birthPlace != null : !BIRTH_PLACE_EDEFAULT.equals(birthPlace);
}
return super.eIsSet(featureID);
}
@@ -373,6 +425,8 @@ public class PersonImpl extends EObjectImpl implements Person {
result.append(phoneNumbers);
result.append(", emergencyContact: ");
result.append(emergencyContact);
+ result.append(", birthPlace: ");
+ result.append(birthPlace);
result.append(')');
return result.toString();
}
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
index f358c7989..0b5a94aac 100644
--- 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
@@ -2,7 +2,7 @@
* <copyright>
* </copyright>
*
- * $Id: UsertypePackageImpl.java,v 1.8 2007/03/04 21:18:27 mtaal Exp $
+ * $Id: UsertypePackageImpl.java,v 1.9 2008/03/30 20:54:58 mtaal Exp $
*/
package org.eclipse.emf.teneo.samples.emf.hibernate.usertype.impl;
@@ -190,6 +190,15 @@ public class UsertypePackageImpl extends EPackageImpl implements UsertypePackage
* <!-- end-user-doc -->
* @generated
*/
+ public EAttribute getPerson_BirthPlace() {
+ return (EAttribute)personEClass.getEStructuralFeatures().get(5);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
public EClass getAddress() {
return addressEClass;
}
@@ -273,6 +282,7 @@ public class UsertypePackageImpl extends EPackageImpl implements UsertypePackage
createEAttribute(personEClass, PERSON__PHONE_NUMBERS);
createEAttribute(personEClass, PERSON__EMERGENCY_CONTACT);
createEReference(personEClass, PERSON__ADDRESSES);
+ createEAttribute(personEClass, PERSON__BIRTH_PLACE);
addressEClass = createEClass(ADDRESS);
createEAttribute(addressEClass, ADDRESS__ADDRESS_INFO);
@@ -316,6 +326,7 @@ public class UsertypePackageImpl extends EPackageImpl implements UsertypePackage
initEAttribute(getPerson_PhoneNumbers(), this.getPhoneNumber(), "phoneNumbers", null, 0, 100, Person.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
initEAttribute(getPerson_EmergencyContact(), this.getPhoneNumber(), "emergencyContact", "", 0, 1, Person.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
initEReference(getPerson_Addresses(), this.getAddress(), this.getAddress_Person(), "addresses", null, 0, -1, Person.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+ initEAttribute(getPerson_BirthPlace(), ecorePackage.getEString(), "birthPlace", null, 1, 1, Person.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
initEClass(addressEClass, Address.class, "Address", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
initEAttribute(getAddress_AddressInfo(), ecorePackage.getEString(), "addressInfo", null, 1, 1, Address.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
@@ -330,26 +341,50 @@ public class UsertypePackageImpl extends EPackageImpl implements UsertypePackage
createResource(eNS_URI);
// Create annotations
- // teneo.jpa
+ // teneo.hibernate
createTeneoAnnotations();
+ // teneo.jpa
+ createTeneo_1Annotations();
// http:///org/eclipse/emf/ecore/util/ExtendedMetaData
createExtendedMetaDataAnnotations();
}
/**
- * Initializes the annotations for <b>teneo.jpa</b>.
+ * Initializes the annotations for <b>teneo.hibernate</b>.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected void createTeneoAnnotations() {
- String source = "teneo.jpa";
+ String source = "teneo.hibernate";
+ addAnnotation
+ (this,
+ source,
+ new String[] {
+ "appinfo", "\t\t\t\t\t\t@NamedQuery(name=\"getPersonByBirthPlace2\" query=\"select p from Person p where p.birthPlace=?\")\n\t\t\t\t\t"
+ });
+ addAnnotation
+ (personEClass,
+ source,
+ new String[] {
+ "appinfo", "\t\t\t\t\t\t@NamedQuery(name=\"getPersonByBirthPlace\" query=\"select p from Person p where p.birthPlace=?\")"
+ });
+ }
+
+ /**
+ * Initializes the annotations for <b>teneo.jpa</b>.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected void createTeneo_1Annotations() {
+ String source = "teneo.jpa";
addAnnotation
(nameEDataType,
source,
new String[] {
"appinfo", "\n\t\t\t\t\t\t@TypeDef(name=\"nameType\" typeClass=\"org.eclipse.emf.teneo.samples.emf.hibernate.usertype.NameType\")\n\t\t\t\t\t\t@Columns({@Column(name=\"first_name\"), @Column(name=\"last_name\")})\n\t\t\t\t\t"
- });
+ });
addAnnotation
(getPerson_Addresses(),
source,
@@ -371,7 +406,7 @@ public class UsertypePackageImpl extends EPackageImpl implements UsertypePackage
* @generated
*/
protected void createExtendedMetaDataAnnotations() {
- String source = "http:///org/eclipse/emf/ecore/util/ExtendedMetaData";
+ String source = "http:///org/eclipse/emf/ecore/util/ExtendedMetaData";
addAnnotation
(nameEDataType,
source,
@@ -384,7 +419,7 @@ public class UsertypePackageImpl extends EPackageImpl implements UsertypePackage
new String[] {
"name", "Person",
"kind", "elementOnly"
- });
+ });
addAnnotation
(getPerson_Name(),
source,
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
index 6f339ff5e..75abee14f 100644
--- 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
@@ -15,6 +15,7 @@
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute usertype.ecore#//Person/phoneNumbers"/>
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute usertype.ecore#//Person/emergencyContact"/>
<genFeatures notify="false" createChild="false" propertySortChoices="true" ecoreFeature="ecore:EReference usertype.ecore#//Person/addresses"/>
+ <genFeatures createChild="false" ecoreFeature="ecore:EAttribute usertype.ecore#//Person/birthPlace"/>
</genClasses>
<genClasses ecoreClass="usertype.ecore#//Address">
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute usertype.ecore#//Address/addressInfo"/>
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
index 8cd11c653..c7c87c003 100644
--- 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
@@ -3,6 +3,9 @@
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">
+ <eAnnotations source="teneo.hibernate">
+ <details key="appinfo" value="&#x9;&#x9;&#x9;&#x9;&#x9;&#x9;@NamedQuery(name=&quot;getPersonByBirthPlace2&quot; query=&quot;select p from Person p where p.birthPlace=?&quot;)&#xA;&#x9;&#x9;&#x9;&#x9;&#x9;"/>
+ </eAnnotations>
<eClassifiers xsi:type="ecore:EDataType" name="Name" instanceClassName="org.eclipse.emf.teneo.samples.emf.hibernate.usertype.Name">
<eAnnotations source="teneo.jpa">
<details key="appinfo" value="&#xA;&#x9;&#x9;&#x9;&#x9;&#x9;&#x9;@TypeDef(name=&quot;nameType&quot; typeClass=&quot;org.eclipse.emf.teneo.samples.emf.hibernate.usertype.NameType&quot;)&#xA;&#x9;&#x9;&#x9;&#x9;&#x9;&#x9;@Columns({@Column(name=&quot;first_name&quot;), @Column(name=&quot;last_name&quot;)})&#xA;&#x9;&#x9;&#x9;&#x9;&#x9;"/>
@@ -16,6 +19,9 @@
<details key="name" value="Person"/>
<details key="kind" value="elementOnly"/>
</eAnnotations>
+ <eAnnotations source="teneo.hibernate">
+ <details key="appinfo" value="&#x9;&#x9;&#x9;&#x9;&#x9;&#x9;@NamedQuery(name=&quot;getPersonByBirthPlace&quot; query=&quot;select p from Person p where p.birthPlace=?&quot;)"/>
+ </eAnnotations>
<eStructuralFeatures xsi:type="ecore:EAttribute" name="name" unique="false" lowerBound="1"
eType="#//Name">
<eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
@@ -40,6 +46,8 @@
<details key="appinfo" value="@OnDelete(action=OnDeleteAction.CASCADE)&#xA;@OneToMany(indexed=false, unique=true)"/>
</eAnnotations>
</eStructuralFeatures>
+ <eStructuralFeatures xsi:type="ecore:EAttribute" name="birthPlace" lowerBound="1"
+ eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
</eClassifiers>
<eClassifiers xsi:type="ecore:EDataType" name="PhoneNumber" instanceClassName="org.eclipse.emf.teneo.samples.emf.hibernate.usertype.UsaPhoneNumber"/>
<eClassifiers xsi:type="ecore:EDataType" name="IntArray" instanceClassName="int[]">
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
index bfd88d4e5..b789d9288 100644
--- 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
@@ -2,7 +2,7 @@
* <copyright>
* </copyright>
*
- * $Id: UsertypeAdapterFactory.java,v 1.4 2007/03/04 21:18:27 mtaal Exp $
+ * $Id: UsertypeAdapterFactory.java,v 1.5 2008/03/30 20:54:58 mtaal Exp $
*/
package org.eclipse.emf.teneo.samples.emf.hibernate.usertype.util;
@@ -63,7 +63,7 @@ public class UsertypeAdapterFactory extends AdapterFactoryImpl {
}
/**
- * The switch the delegates to the <code>createXXX</code> methods.
+ * The switch that delegates to the <code>createXXX</code> methods.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
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
index dd62a1cce..e4125a5f0 100644
--- 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
@@ -2,7 +2,7 @@
* <copyright>
* </copyright>
*
- * $Id: UsertypeSwitch.java,v 1.4 2007/03/04 21:18:27 mtaal Exp $
+ * $Id: UsertypeSwitch.java,v 1.5 2008/03/30 20:54:58 mtaal Exp $
*/
package org.eclipse.emf.teneo.samples.emf.hibernate.usertype.util;
@@ -104,13 +104,13 @@ public class UsertypeSwitch {
}
/**
- * Returns the result of interpretting the object as an instance of '<em>Person</em>'.
+ * Returns the result of interpreting 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>'.
+ * @return the result of interpreting the object as an instance of '<em>Person</em>'.
* @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
* @generated
*/
@@ -119,13 +119,13 @@ public class UsertypeSwitch {
}
/**
- * Returns the result of interpretting the object as an instance of '<em>Address</em>'.
+ * Returns the result of interpreting the object as an instance of '<em>Address</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>Address</em>'.
+ * @return the result of interpreting the object as an instance of '<em>Address</em>'.
* @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
* @generated
*/
@@ -134,13 +134,13 @@ public class UsertypeSwitch {
}
/**
- * Returns the result of interpretting the object as an instance of '<em>EObject</em>'.
+ * Returns the result of interpreting 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>'.
+ * @return the result of interpreting the object as an instance of '<em>EObject</em>'.
* @see #doSwitch(org.eclipse.emf.ecore.EObject)
* @generated
*/

Back to the top