| 
| [Teneo] Still newbie questions [message #119171] | Sat, 19 April 2008 08:04  |  | 
| Eclipse User  |  |  |  |  | Originally posted by: tom.eiswind.de 
 Hi I try to get started, but I dont get it. Maybe someone can give me a
 pointer. I have a simple model
 
 <?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="mango"
 nsURI="http://mango.ecorediag/1.0" nsPrefix="mango">
 <eClassifiers xsi:type="ecore:EClass" name="ValueList"
 eSuperTypes="#//BaseEntity">
 <eStructuralFeatures xsi:type="ecore:EAttribute" name="name"
 eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
 <eStructuralFeatures xsi:type="ecore:EReference"
 name="defaultValue" eType="#//Value"/>
 <eStructuralFeatures xsi:type="ecore:EReference" name="values"
 upperBound="-1"
 eType="#//Value"/>
 </eClassifiers>
 <eClassifiers xsi:type="ecore:EClass" name="BaseEntity">
 <eAnnotations source="teneo.jpa">
 <details key="appinfo" value="@MappedSuperclass"/>
 </eAnnotations>
 <eStructuralFeatures xsi:type="ecore:EAttribute" name="text"
 eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
 </eClassifiers>
 <eClassifiers xsi:type="ecore:EClass" name="Value"
 eSuperTypes="#//BaseEntity">
 <eStructuralFeatures xsi:type="ecore:EAttribute" name="name"
 eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
 </eClassifiers>
 </ecore:EPackage>
 
 but it seems to ignore the MappedSuperclass annotation as it generates
 
 <?xml version="1.0" encoding="UTF-8"?>
 <!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD
 3.0//EN" "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
 
 <hibernate-mapping auto-import="false">
 <class name="mango.impl.BaseEntityImpl" entity-name="BaseEntity"
 abstract="false" lazy="false" discriminator-value="BaseEntity"
 table="`baseentity`">
 <meta attribute="eclassName">BaseEntity</meta>
 <meta attribute="epackage">http://mango.ecorediag/1.0</meta>
 <id type="long" name="e_id" column="e_id"
 access=" org.eclipse.emf.teneo.hibernate.mapping.identifier.Identifie rPropertyHandler ">
 <meta attribute="syntheticId">true</meta>
 <generator class="native"/>
 </id>
 <discriminator column="`dtype`" type="string"/>
 <version name="e_version" column="e_version"
 access=" org.eclipse.emf.teneo.hibernate.mapping.property.VersionProp ertyHandler ">
 <meta attribute="syntheticVersion">true</meta>
 </version>
 <property name="text" lazy="false" insert="true" update="true"
 not-null="false" unique="false" type="java.lang.String">
 <column not-null="false" unique="false" name="`text`"/>
 </property>
 </class>
 <subclass name="mango.impl.ValueListImpl" entity-name="ValueList"
 abstract="false" lazy="false" extends="BaseEntity"
 discriminator-value="ValueList">
 <meta attribute="eclassName">ValueList</meta>
 <meta attribute="epackage">http://mango.ecorediag/1.0</meta>
 <property name="name" lazy="false" insert="true" update="true"
 not-null="false" unique="false" type="java.lang.String">
 <column not-null="false" unique="false" name="`name`"/>
 </property>
 <many-to-one name="defaultValue" entity-name="Value"
 foreign-key="valuelist_defaultvalue" lazy="false" insert="true"
 update="true" not-null="false">
 <column not-null="false" unique="false"
 name="`value_defaultvalue_e_id`"/>
 </many-to-one>
 <list name="values" table="`valuelist_values`" lazy="true">
 <key update="true">
 <column name="`valuelist_e_id`" not-null="true" unique="false"/>
 </key>
 <list-index column="`valuelist_values_idx`"/>
 <many-to-many entity-name="Value" unique="true"
 foreign-key="valuelist_values">
 <column name="`value_e_id`" not-null="true" unique="false"/>
 </many-to-many>
 </list>
 </subclass>
 <class name="mango.impl.ValueImpl" entity-name="Value" abstract="false"
 lazy="false" discriminator-value="Value" table="`value`">
 <meta attribute="eclassName">Value</meta>
 <meta attribute="epackage">http://mango.ecorediag/1.0</meta>
 <id type="long" name="e_id" column="e_id"
 access=" org.eclipse.emf.teneo.hibernate.mapping.identifier.Identifie rPropertyHandler ">
 <meta attribute="syntheticId">true</meta>
 <generator class="native"/>
 </id>
 <discriminator column="`dtype`" type="string"/>
 <version name="e_version" column="e_version"
 access=" org.eclipse.emf.teneo.hibernate.mapping.property.VersionProp ertyHandler ">
 <meta attribute="syntheticVersion">true</meta>
 </version>
 <property name="name" lazy="false" insert="true" update="true"
 not-null="false" unique="false" type="java.lang.String">
 <column not-null="false" unique="false" name="`name`"/>
 </property>
 </class>
 </hibernate-mapping>
 |  |  |  | 
|  | 
| 
| Re: [Teneo] Still newbie questions [message #119272 is a reply to message #119208] | Sun, 20 April 2008 01:22  |  | 
| Eclipse User  |  |  |  |  | Hi Thomas, teneo.jpa should also work. Did you regenerate the java model code after setting the annotation?
 
 gr. Martin
 
 Thomas wrote:
 > I see I had to use teneo.hibernate instead of teneo.jpa
 
 
 --
 
 With Regards, Martin Taal
 
 Springsite/Elver.org
 Office: Hardwareweg 4, 3821 BV Amersfoort
 Postal: Nassaulaan 7, 3941 EC Doorn
 The Netherlands
 Tel: +31 (0)84 420 2397
 Fax: +31 (0)84 225 9307
 Mail: mtaal@springsite.com - mtaal@elver.org
 Web: www.springsite.com - www.elver.org
 |  |  |  | 
|  | 
| 
| Re: [Teneo] Still newbie questions [message #617855 is a reply to message #119208] | Sun, 20 April 2008 01:22  |  | 
| Eclipse User  |  |  |  |  | Hi Thomas, teneo.jpa should also work. Did you regenerate the java model code after setting the annotation?
 
 gr. Martin
 
 Thomas wrote:
 > I see I had to use teneo.hibernate instead of teneo.jpa
 
 
 --
 
 With Regards, Martin Taal
 
 Springsite/Elver.org
 Office: Hardwareweg 4, 3821 BV Amersfoort
 Postal: Nassaulaan 7, 3941 EC Doorn
 The Netherlands
 Tel: +31 (0)84 420 2397
 Fax: +31 (0)84 225 9307
 Mail: mtaal@springsite.com - mtaal@elver.org
 Web: www.springsite.com - www.elver.org
 |  |  |  | 
Powered by 
FUDForum. Page generated in 0.03796 seconds