Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF "Technology" (Ecore Tools, EMFatic, etc)  » [Teneo] Invalid subclass tag in hibernate mapping file .
[Teneo] Invalid subclass tag in hibernate mapping file . [message #74403] Thu, 08 March 2007 17:33 Go to next message
Duncan Alexander is currently offline Duncan AlexanderFriend
Messages: 90
Registered: July 2009
Member
This is a multi-part message in MIME format.
--------------060605040602010802090609
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit

Hi,
im having an issue with my hibernate mapping file as generated by
teneo. The issue seems to be an <id> and <version> tags which have been
inserted below a <subclass> tag. I don't believe this is allowed and Im
getting an error when attempting to use the config file of the form:


org.hibernate.InvalidMappingException: Could not parse mapping document
from resource hibernate_sdmx_config.xml
at org.hibernate.cfg.Configuration.addResource(Configuration.ja va:569)
at etc etc etc.
... 31 more
Caused by: org.xml.sax.SAXParseException: The content of element type
"subclass" must match
" (meta*,tuplizer*,synchronize*,(property|many-to-one|one-to-o ne|component|dynamic-component|any|map|set|list|bag|idbag|ar ray|primitive-array)*,join*,subclass*,loader?,sql-insert?,sq l-update?,sql-delete?,resultset*,(query|sql-query)*) ".
at
com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper. createSAXParseException(ErrorHandlerWrapper.java:236)
.... etc etc etc

The section in question is attached.


My current setup is: Teneo 0.75, EMF2.2, Hibernate 3.2

Any help greatly appreciated.

Duncan

--------------060605040602010802090609
Content-Type: text/plain;
name="snippit.txt"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
filename="snippit.txt"

<subclass entity-name="Identifiable" abstract="true" lazy="false" extends="Annotable" discriminator-value="Identifiable">
<meta attribute="eclassName">Identifiable</meta>
<meta attribute="epackage">http://www.sdmx.org/resources/infomodel/1.0/base.xmi</meta>
<id name="urn" type="java.lang.String">
<column not-null="true" unique="false" name="`urn`"/>
</id>
<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="id" lazy="false" insert="true" update="true" not-null="false" unique="false" type="java.lang.String">
<column not-null="false" unique="false" name="`id`"/>
</property>
<property name="uri" lazy="false" insert="true" update="true" not-null="false" unique="false" type="java.lang.String">
<column not-null="false" unique="false" name="`uri`"/>
</property>
<many-to-one name="Name" entity-name="InternationalString" cascade="all" lazy="false" insert="true" update="true" not-null="false">
<column not-null="false" unique="false" name="`internationalstring_name_e_id`"/>
</many-to-one>
<many-to-one name="Description" entity-name="InternationalString" cascade="all" lazy="false" insert="true" update="true" not-null="false">
<column not-null="false" unique="false" name="`internationalstring_description_e_id`"/>
</many-to-one>
</subclass>
--------------060605040602010802090609--
Re: [Teneo] Invalid subclass tag in hibernate mapping file . [message #74421 is a reply to message #74403] Thu, 08 March 2007 17:54 Go to previous messageGo to next message
Martin Taal is currently offline Martin TaalFriend
Messages: 5468
Registered: July 2009
Senior Member
Yes this seems to be a bug. Can you enter a bugzilla for this and attach the ecore files to that? If
you don't want to have your model publically accessible you can also send the ecores to me directly.

gr. Martin

Duncan ALexander wrote:
> Hi,
> im having an issue with my hibernate mapping file as generated by
> teneo. The issue seems to be an <id> and <version> tags which have been
> inserted below a <subclass> tag. I don't believe this is allowed and Im
> getting an error when attempting to use the config file of the form:
>
>
> org.hibernate.InvalidMappingException: Could not parse mapping document
> from resource hibernate_sdmx_config.xml
> at org.hibernate.cfg.Configuration.addResource(Configuration.ja va:569)
> at etc etc etc.
> ... 31 more
> Caused by: org.xml.sax.SAXParseException: The content of element type
> "subclass" must match
> " (meta*,tuplizer*,synchronize*,(property|many-to-one|one-to-o ne|component|dynamic-component|any|map|set|list|bag|idbag|ar ray|primitive-array)*,join*,subclass*,loader?,sql-insert?,sq l-update?,sql-delete?,resultset*,(query|sql-query)*) ".
>
> at
> com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper. createSAXParseException(ErrorHandlerWrapper.java:236)
>
> .... etc etc etc
>
> The section in question is attached.
>
>
> My current setup is: Teneo 0.75, EMF2.2, Hibernate 3.2
>
> Any help greatly appreciated.
>
> Duncan
>
>
> ------------------------------------------------------------ ------------
>
> <subclass entity-name="Identifiable" abstract="true" lazy="false" extends="Annotable" discriminator-value="Identifiable">
> <meta attribute="eclassName">Identifiable</meta>
> <meta attribute="epackage">http://www.sdmx.org/resources/infomodel/1.0/base.xmi</meta>
> <id name="urn" type="java.lang.String">
> <column not-null="true" unique="false" name="`urn`"/>
> </id>
> <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="id" lazy="false" insert="true" update="true" not-null="false" unique="false" type="java.lang.String">
> <column not-null="false" unique="false" name="`id`"/>
> </property>
> <property name="uri" lazy="false" insert="true" update="true" not-null="false" unique="false" type="java.lang.String">
> <column not-null="false" unique="false" name="`uri`"/>
> </property>
> <many-to-one name="Name" entity-name="InternationalString" cascade="all" lazy="false" insert="true" update="true" not-null="false">
> <column not-null="false" unique="false" name="`internationalstring_name_e_id`"/>
> </many-to-one>
> <many-to-one name="Description" entity-name="InternationalString" cascade="all" lazy="false" insert="true" update="true" not-null="false">
> <column not-null="false" unique="false" name="`internationalstring_description_e_id`"/>
> </many-to-one>
> </subclass>


--

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] Invalid subclass tag in hibernate mapping file . [message #74600 is a reply to message #74421] Fri, 09 March 2007 14:11 Go to previous messageGo to next message
Duncan Alexander is currently offline Duncan AlexanderFriend
Messages: 90
Registered: July 2009
Member
Hi
Bug added as No: 176821

ECore files mailed directly to you (Martin).

regards

Duncan

Martin Taal wrote:
> Yes this seems to be a bug. Can you enter a bugzilla for this and attach
> the ecore files to that? If you don't want to have your model publically
> accessible you can also send the ecores to me directly.
>
> gr. Martin
>
> Duncan ALexander wrote:
>> Hi,
>> im having an issue with my hibernate mapping file as generated by
>> teneo. The issue seems to be an <id> and <version> tags which have
>> been inserted below a <subclass> tag. I don't believe this is allowed
>> and Im getting an error when attempting to use the config file of the
>> form:
>>
>>
>> org.hibernate.InvalidMappingException: Could not parse mapping
>> document from resource hibernate_sdmx_config.xml
>> at
>> org.hibernate.cfg.Configuration.addResource(Configuration.ja va:569)
>> at etc etc etc.
>> ... 31 more
>> Caused by: org.xml.sax.SAXParseException: The content of element type
>> "subclass" must match
>> " (meta*,tuplizer*,synchronize*,(property|many-to-one|one-to-o ne|component|dynamic-component|any|map|set|list|bag|idbag|ar ray|primitive-array)*,join*,subclass*,loader?,sql-insert?,sq l-update?,sql-delete?,resultset*,(query|sql-query)*) ".
>>
>> at
>> com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper. createSAXParseException(ErrorHandlerWrapper.java:236)
>>
>> .... etc etc etc
>>
>> The section in question is attached.
>>
>>
>> My current setup is: Teneo 0.75, EMF2.2, Hibernate 3.2
>>
>> Any help greatly appreciated.
>>
>> Duncan
>>
>>
>> ------------------------------------------------------------ ------------
>>
>> <subclass entity-name="Identifiable" abstract="true" lazy="false"
>> extends="Annotable" discriminator-value="Identifiable">
>> <meta attribute="eclassName">Identifiable</meta>
>> <meta
>> attribute="epackage">http://www.sdmx.org/resources/infomodel/1.0/base.xmi</meta>
>>
>> <id name="urn" type="java.lang.String">
>> <column not-null="true" unique="false" name="`urn`"/>
>> </id>
>> <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="id" lazy="false" insert="true" update="true"
>> not-null="false" unique="false" type="java.lang.String">
>> <column not-null="false" unique="false" name="`id`"/>
>> </property>
>> <property name="uri" lazy="false" insert="true" update="true"
>> not-null="false" unique="false" type="java.lang.String">
>> <column not-null="false" unique="false" name="`uri`"/>
>> </property>
>> <many-to-one name="Name" entity-name="InternationalString"
>> cascade="all" lazy="false" insert="true" update="true" not-null="false">
>> <column not-null="false" unique="false"
>> name="`internationalstring_name_e_id`"/>
>> </many-to-one>
>> <many-to-one name="Description"
>> entity-name="InternationalString" cascade="all" lazy="false"
>> insert="true" update="true" not-null="false">
>> <column not-null="false" unique="false"
>> name="`internationalstring_description_e_id`"/>
>> </many-to-one>
>> </subclass>
>
>
Re: [Teneo] Invalid subclass tag in hibernate mapping file . [message #74906 is a reply to message #74600] Sun, 11 March 2007 16:22 Go to previous messageGo to next message
Duncan Alexander is currently offline Duncan AlexanderFriend
Messages: 90
Registered: July 2009
Member
Hi Martin,
with regard to your answer in Bugzilla (below)

note: Im generating my ecore from a Rose model.

Is it possible to mark something as a MappedSuperclass within a Rose model or would the actual
..ecore file need to be updated to reflect the new annotation or does Teneo also look at the code
generated from the .ecore file where it would be able to see any additional annotations ?

I've done a fair bit of digging before asking this question as I thought I would be able to work it
out but I'm afraid I hit a blank.

regards

Duncan

------- Comment #1 From Martin taal 2007-03-09 12:59:02 [reply] -------

Hi,
I checked the ecore files and the Identifiable has an efeature (urn) with the
id property (in ecore) set to true). This means that this efeature is mapped as
the id. Teneo does this eventhough it is a subclass (it is considered to be the
designers responsibility to assign id's only to the root of the inheritance
structure).
There is an option (PersistenceOptions.ID_FEATURE_AS_PRIMARY_KEY) to control if
Teneo should use the id=true efeatures as the pk. You can set this to false.
Another approach could be to map the annotatable as a @MappedSuperclass.

Let me know if this answers this issue.

gr. Martin

-----------



Duncan ALexander wrote:
> Hi
> Bug added as No: 176821
>
> ECore files mailed directly to you (Martin).
>
> regards
>
> Duncan
>
> Martin Taal wrote:
>> Yes this seems to be a bug. Can you enter a bugzilla for this and
>> attach the ecore files to that? If you don't want to have your model
>> publically accessible you can also send the ecores to me directly.
>>
>> gr. Martin
>>
>> Duncan ALexander wrote:
>>> Hi,
>>> im having an issue with my hibernate mapping file as generated by
>>> teneo. The issue seems to be an <id> and <version> tags which have
>>> been inserted below a <subclass> tag. I don't believe this is allowed
>>> and Im getting an error when attempting to use the config file of the
>>> form:
>>>
>>>
>>> org.hibernate.InvalidMappingException: Could not parse mapping
>>> document from resource hibernate_sdmx_config.xml
>>> at
>>> org.hibernate.cfg.Configuration.addResource(Configuration.ja va:569)
>>> at etc etc etc.
>>> ... 31 more
>>> Caused by: org.xml.sax.SAXParseException: The content of element type
>>> "subclass" must match
>>> " (meta*,tuplizer*,synchronize*,(property|many-to-one|one-to-o ne|component|dynamic-component|any|map|set|list|bag|idbag|ar ray|primitive-array)*,join*,subclass*,loader?,sql-insert?,sq l-update?,sql-delete?,resultset*,(query|sql-query)*) ".
>>>
>>> at
>>> com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper. createSAXParseException(ErrorHandlerWrapper.java:236)
>>>
>>> .... etc etc etc
>>>
>>> The section in question is attached.
>>>
>>>
>>> My current setup is: Teneo 0.75, EMF2.2, Hibernate 3.2
>>>
>>> Any help greatly appreciated.
>>>
>>> Duncan
>>>
>>>
>>> ------------------------------------------------------------ ------------
>>>
>>> <subclass entity-name="Identifiable" abstract="true" lazy="false"
>>> extends="Annotable" discriminator-value="Identifiable">
>>> <meta attribute="eclassName">Identifiable</meta>
>>> <meta
>>> attribute="epackage">http://www.sdmx.org/resources/infomodel/1.0/base.xmi</meta>
>>>
>>> <id name="urn" type="java.lang.String">
>>> <column not-null="true" unique="false" name="`urn`"/>
>>> </id>
>>> <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="id" lazy="false" insert="true" update="true"
>>> not-null="false" unique="false" type="java.lang.String">
>>> <column not-null="false" unique="false" name="`id`"/>
>>> </property>
>>> <property name="uri" lazy="false" insert="true" update="true"
>>> not-null="false" unique="false" type="java.lang.String">
>>> <column not-null="false" unique="false" name="`uri`"/>
>>> </property>
>>> <many-to-one name="Name" entity-name="InternationalString"
>>> cascade="all" lazy="false" insert="true" update="true" not-null="false">
>>> <column not-null="false" unique="false"
>>> name="`internationalstring_name_e_id`"/>
>>> </many-to-one>
>>> <many-to-one name="Description"
>>> entity-name="InternationalString" cascade="all" lazy="false"
>>> insert="true" update="true" not-null="false">
>>> <column not-null="false" unique="false"
>>> name="`internationalstring_description_e_id`"/>
>>> </many-to-one>
>>> </subclass>
>>
>>
Re: [Teneo] Invalid subclass tag in hibernate mapping file . [message #74920 is a reply to message #74906] Sun, 11 March 2007 16:32 Go to previous messageGo to next message
Martin Taal is currently offline Martin TaalFriend
Messages: 5468
Registered: July 2009
Senior Member
Hi Duncan,
You can enter a @MappedSuperClass annotation in Rose. I don't know how to do this though, maybe
searching on the emf newsgroup gives the answer. Otherwise you can ask there how to do that.

You can also specify jpa annotations in a separate xml file so that you don't need to adapt the
ecore (or Rose) itself:
http://www.elver.org/hibernate/ejb3_format.html#xml
(see that I need to edit this part of the website, it mentions jpoxdatastore, should be hbdatastore).

gr. Martin

Duncan ALexander wrote:
> Hi Martin,
> with regard to your answer in Bugzilla (below)
>
> note: Im generating my ecore from a Rose model.
>
> Is it possible to mark something as a MappedSuperclass within a Rose
> model or would the actual ..ecore file need to be updated to reflect the
> new annotation or does Teneo also look at the code generated from the
> .ecore file where it would be able to see any additional annotations ?
>
> I've done a fair bit of digging before asking this question as I thought
> I would be able to work it out but I'm afraid I hit a blank.
>
> regards
>
> Duncan
>
> ------- Comment #1 From Martin taal 2007-03-09 12:59:02 [reply] -------
>
> Hi,
> I checked the ecore files and the Identifiable has an efeature (urn)
> with the
> id property (in ecore) set to true). This means that this efeature is
> mapped as
> the id. Teneo does this eventhough it is a subclass (it is considered to
> be the
> designers responsibility to assign id's only to the root of the inheritance
> structure).
> There is an option (PersistenceOptions.ID_FEATURE_AS_PRIMARY_KEY) to
> control if
> Teneo should use the id=true efeatures as the pk. You can set this to
> false.
> Another approach could be to map the annotatable as a @MappedSuperclass.
>
> Let me know if this answers this issue.
>
> gr. Martin
>
> -----------
>
>
>
> Duncan ALexander wrote:
>> Hi
>> Bug added as No: 176821
>>
>> ECore files mailed directly to you (Martin).
>>
>> regards
>>
>> Duncan
>>
>> Martin Taal wrote:
>>> Yes this seems to be a bug. Can you enter a bugzilla for this and
>>> attach the ecore files to that? If you don't want to have your model
>>> publically accessible you can also send the ecores to me directly.
>>>
>>> gr. Martin
>>>
>>> Duncan ALexander wrote:
>>>> Hi,
>>>> im having an issue with my hibernate mapping file as generated by
>>>> teneo. The issue seems to be an <id> and <version> tags which have
>>>> been inserted below a <subclass> tag. I don't believe this is
>>>> allowed and Im getting an error when attempting to use the config
>>>> file of the form:
>>>>
>>>>
>>>> org.hibernate.InvalidMappingException: Could not parse mapping
>>>> document from resource hibernate_sdmx_config.xml
>>>> at
>>>> org.hibernate.cfg.Configuration.addResource(Configuration.ja va:569)
>>>> at etc etc etc.
>>>> ... 31 more
>>>> Caused by: org.xml.sax.SAXParseException: The content of element
>>>> type "subclass" must match
>>>> " (meta*,tuplizer*,synchronize*,(property|many-to-one|one-to-o ne|component|dynamic-component|any|map|set|list|bag|idbag|ar ray|primitive-array)*,join*,subclass*,loader?,sql-insert?,sq l-update?,sql-delete?,resultset*,(query|sql-query)*) ".
>>>>
>>>> at
>>>> com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper. createSAXParseException(ErrorHandlerWrapper.java:236)
>>>>
>>>> .... etc etc etc
>>>>
>>>> The section in question is attached.
>>>>
>>>>
>>>> My current setup is: Teneo 0.75, EMF2.2, Hibernate 3.2
>>>>
>>>> Any help greatly appreciated.
>>>>
>>>> Duncan
>>>>
>>>>
>>>> ------------------------------------------------------------ ------------
>>>>
>>>>
>>>> <subclass entity-name="Identifiable" abstract="true" lazy="false"
>>>> extends="Annotable" discriminator-value="Identifiable">
>>>> <meta attribute="eclassName">Identifiable</meta>
>>>> <meta
>>>> attribute="epackage">http://www.sdmx.org/resources/infomodel/1.0/base.xmi</meta>
>>>>
>>>> <id name="urn" type="java.lang.String">
>>>> <column not-null="true" unique="false" name="`urn`"/>
>>>> </id>
>>>> <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="id" lazy="false" insert="true" update="true"
>>>> not-null="false" unique="false" type="java.lang.String">
>>>> <column not-null="false" unique="false" name="`id`"/>
>>>> </property>
>>>> <property name="uri" lazy="false" insert="true"
>>>> update="true" not-null="false" unique="false" type="java.lang.String">
>>>> <column not-null="false" unique="false" name="`uri`"/>
>>>> </property>
>>>> <many-to-one name="Name" entity-name="InternationalString"
>>>> cascade="all" lazy="false" insert="true" update="true"
>>>> not-null="false">
>>>> <column not-null="false" unique="false"
>>>> name="`internationalstring_name_e_id`"/>
>>>> </many-to-one>
>>>> <many-to-one name="Description"
>>>> entity-name="InternationalString" cascade="all" lazy="false"
>>>> insert="true" update="true" not-null="false">
>>>> <column not-null="false" unique="false"
>>>> name="`internationalstring_description_e_id`"/>
>>>> </many-to-one>
>>>> </subclass>
>>>
>>>


--

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] Invalid subclass tag in hibernate mapping file . [message #74954 is a reply to message #74920] Sun, 11 March 2007 17:45 Go to previous messageGo to next message
Duncan Alexander is currently offline Duncan AlexanderFriend
Messages: 90
Registered: July 2009
Member
Hi Martin,
As I cant find any clear info on the newsgroups on how to add the MappedSuperClass annotation to
the Rose model I think it would be easier to add it directly to the generated .ecore
file...or....should I be adding it to the generated java file ?

Is it Teneo that will be checking for this annotation (as opposed to Hibernate) and if so
what format would the annotation have in an .ecore file ?

I assume that it would look like this in the ecore:

<eAnnotations source="http://someURLOrAnother">
<details key="MappedSuperClass" value="true"/>
</eAnnotations>



Duncan

Martin Taal wrote:
> Hi Duncan,
> You can enter a @MappedSuperClass annotation in Rose. I don't know how
> to do this though, maybe searching on the emf newsgroup gives the
> answer. Otherwise you can ask there how to do that.
>
> You can also specify jpa annotations in a separate xml file so that you
> don't need to adapt the ecore (or Rose) itself:
> http://www.elver.org/hibernate/ejb3_format.html#xml
> (see that I need to edit this part of the website, it mentions
> jpoxdatastore, should be hbdatastore).
>
> gr. Martin
>
> Duncan ALexander wrote:
>> Hi Martin,
>> with regard to your answer in Bugzilla (below)
>>
>> note: Im generating my ecore from a Rose model.
>>
>> Is it possible to mark something as a MappedSuperclass within a Rose
>> model or would the actual ..ecore file need to be updated to reflect
>> the new annotation or does Teneo also look at the code generated from
>> the .ecore file where it would be able to see any additional
>> annotations ?
>>
>> I've done a fair bit of digging before asking this question as I
>> thought I would be able to work it out but I'm afraid I hit a blank.
>>
>> regards
>>
>> Duncan
>>
>> ------- Comment #1 From Martin taal 2007-03-09 12:59:02 [reply]
>> -------
>>
>> Hi,
>> I checked the ecore files and the Identifiable has an efeature (urn)
>> with the
>> id property (in ecore) set to true). This means that this efeature is
>> mapped as
>> the id. Teneo does this eventhough it is a subclass (it is considered
>> to be the
>> designers responsibility to assign id's only to the root of the
>> inheritance
>> structure).
>> There is an option (PersistenceOptions.ID_FEATURE_AS_PRIMARY_KEY) to
>> control if
>> Teneo should use the id=true efeatures as the pk. You can set this to
>> false.
>> Another approach could be to map the annotatable as a @MappedSuperclass.
>>
>> Let me know if this answers this issue.
>>
>> gr. Martin
>>
>> -----------
>>
>>
>>
>> Duncan ALexander wrote:
>>> Hi
>>> Bug added as No: 176821
>>>
>>> ECore files mailed directly to you (Martin).
>>>
>>> regards
>>>
>>> Duncan
>>>
>>> Martin Taal wrote:
>>>> Yes this seems to be a bug. Can you enter a bugzilla for this and
>>>> attach the ecore files to that? If you don't want to have your model
>>>> publically accessible you can also send the ecores to me directly.
>>>>
>>>> gr. Martin
>>>>
>>>> Duncan ALexander wrote:
>>>>> Hi,
>>>>> im having an issue with my hibernate mapping file as generated
>>>>> by teneo. The issue seems to be an <id> and <version> tags which
>>>>> have been inserted below a <subclass> tag. I don't believe this is
>>>>> allowed and Im getting an error when attempting to use the config
>>>>> file of the form:
>>>>>
>>>>>
>>>>> org.hibernate.InvalidMappingException: Could not parse mapping
>>>>> document from resource hibernate_sdmx_config.xml
>>>>> at
>>>>> org.hibernate.cfg.Configuration.addResource(Configuration.ja va:569)
>>>>> at etc etc etc.
>>>>> ... 31 more
>>>>> Caused by: org.xml.sax.SAXParseException: The content of element
>>>>> type "subclass" must match
>>>>> " (meta*,tuplizer*,synchronize*,(property|many-to-one|one-to-o ne|component|dynamic-component|any|map|set|list|bag|idbag|ar ray|primitive-array)*,join*,subclass*,loader?,sql-insert?,sq l-update?,sql-delete?,resultset*,(query|sql-query)*) ".
>>>>>
>>>>> at
>>>>> com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper. createSAXParseException(ErrorHandlerWrapper.java:236)
>>>>>
>>>>> .... etc etc etc
>>>>>
>>>>> The section in question is attached.
>>>>>
>>>>>
>>>>> My current setup is: Teneo 0.75, EMF2.2, Hibernate 3.2
>>>>>
>>>>> Any help greatly appreciated.
>>>>>
>>>>> Duncan
>>>>>
>>>>>
>>>>> ------------------------------------------------------------ ------------
>>>>>
>>>>>
>>>>> <subclass entity-name="Identifiable" abstract="true" lazy="false"
>>>>> extends="Annotable" discriminator-value="Identifiable">
>>>>> <meta attribute="eclassName">Identifiable</meta>
>>>>> <meta
>>>>> attribute="epackage">http://www.sdmx.org/resources/infomodel/1.0/base.xmi</meta>
>>>>>
>>>>> <id name="urn" type="java.lang.String">
>>>>> <column not-null="true" unique="false" name="`urn`"/>
>>>>> </id>
>>>>> <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="id" lazy="false" insert="true"
>>>>> update="true" not-null="false" unique="false" type="java.lang.String">
>>>>> <column not-null="false" unique="false" name="`id`"/>
>>>>> </property>
>>>>> <property name="uri" lazy="false" insert="true"
>>>>> update="true" not-null="false" unique="false" type="java.lang.String">
>>>>> <column not-null="false" unique="false" name="`uri`"/>
>>>>> </property>
>>>>> <many-to-one name="Name" entity-name="InternationalString"
>>>>> cascade="all" lazy="false" insert="true" update="true"
>>>>> not-null="false">
>>>>> <column not-null="false" unique="false"
>>>>> name="`internationalstring_name_e_id`"/>
>>>>> </many-to-one>
>>>>> <many-to-one name="Description"
>>>>> entity-name="InternationalString" cascade="all" lazy="false"
>>>>> insert="true" update="true" not-null="false">
>>>>> <column not-null="false" unique="false"
>>>>> name="`internationalstring_description_e_id`"/>
>>>>> </many-to-one>
>>>>> </subclass>
>>>>
>>>>
>
>
Re: [Teneo] Invalid subclass tag in hibernate mapping file . [message #74963 is a reply to message #74954] Sun, 11 March 2007 18:30 Go to previous message
Duncan Alexander is currently offline Duncan AlexanderFriend
Messages: 90
Registered: July 2009
Member
Actually,
I just found this in the eclipse newsgroups which I believe explains the format annotations should
have in the .ecore file.

http://dev.eclipse.org/newslists/news.eclipse.technology.emf t/msg01342.html

Ill try this out first.

thanks Martin for your assistance.

Duncan

Duncan ALexander wrote:
> Hi Martin,
> As I cant find any clear info on the newsgroups on how to add the
> MappedSuperClass annotation to the Rose model I think it would be easier
> to add it directly to the generated .ecore file...or....should I be
> adding it to the generated java file ?
>
> Is it Teneo that will be checking for this annotation (as opposed to
> Hibernate) and if so
> what format would the annotation have in an .ecore file ?
>
> I assume that it would look like this in the ecore:
>
> <eAnnotations source="http://someURLOrAnother">
> <details key="MappedSuperClass" value="true"/>
> </eAnnotations>
>
>
>
> Duncan
>
> Martin Taal wrote:
>> Hi Duncan,
>> You can enter a @MappedSuperClass annotation in Rose. I don't know how
>> to do this though, maybe searching on the emf newsgroup gives the
>> answer. Otherwise you can ask there how to do that.
>>
>> You can also specify jpa annotations in a separate xml file so that
>> you don't need to adapt the ecore (or Rose) itself:
>> http://www.elver.org/hibernate/ejb3_format.html#xml
>> (see that I need to edit this part of the website, it mentions
>> jpoxdatastore, should be hbdatastore).
>>
>> gr. Martin
>>
>> Duncan ALexander wrote:
>>> Hi Martin,
>>> with regard to your answer in Bugzilla (below)
>>>
>>> note: Im generating my ecore from a Rose model.
>>>
>>> Is it possible to mark something as a MappedSuperclass within a Rose
>>> model or would the actual ..ecore file need to be updated to reflect
>>> the new annotation or does Teneo also look at the code generated from
>>> the .ecore file where it would be able to see any additional
>>> annotations ?
>>>
>>> I've done a fair bit of digging before asking this question as I
>>> thought I would be able to work it out but I'm afraid I hit a blank.
>>>
>>> regards
>>>
>>> Duncan
>>>
>>> ------- Comment #1 From Martin taal 2007-03-09 12:59:02 [reply]
>>> -------
>>>
>>> Hi,
>>> I checked the ecore files and the Identifiable has an efeature (urn)
>>> with the
>>> id property (in ecore) set to true). This means that this efeature is
>>> mapped as
>>> the id. Teneo does this eventhough it is a subclass (it is considered
>>> to be the
>>> designers responsibility to assign id's only to the root of the
>>> inheritance
>>> structure).
>>> There is an option (PersistenceOptions.ID_FEATURE_AS_PRIMARY_KEY) to
>>> control if
>>> Teneo should use the id=true efeatures as the pk. You can set this to
>>> false.
>>> Another approach could be to map the annotatable as a @MappedSuperclass.
>>>
>>> Let me know if this answers this issue.
>>>
>>> gr. Martin
>>>
>>> -----------
>>>
>>>
>>>
>>> Duncan ALexander wrote:
>>>> Hi
>>>> Bug added as No: 176821
>>>>
>>>> ECore files mailed directly to you (Martin).
>>>>
>>>> regards
>>>>
>>>> Duncan
>>>>
>>>> Martin Taal wrote:
>>>>> Yes this seems to be a bug. Can you enter a bugzilla for this and
>>>>> attach the ecore files to that? If you don't want to have your
>>>>> model publically accessible you can also send the ecores to me
>>>>> directly.
>>>>>
>>>>> gr. Martin
>>>>>
>>>>> Duncan ALexander wrote:
>>>>>> Hi,
>>>>>> im having an issue with my hibernate mapping file as generated
>>>>>> by teneo. The issue seems to be an <id> and <version> tags which
>>>>>> have been inserted below a <subclass> tag. I don't believe this is
>>>>>> allowed and Im getting an error when attempting to use the config
>>>>>> file of the form:
>>>>>>
>>>>>>
>>>>>> org.hibernate.InvalidMappingException: Could not parse mapping
>>>>>> document from resource hibernate_sdmx_config.xml
>>>>>> at
>>>>>> org.hibernate.cfg.Configuration.addResource(Configuration.ja va:569)
>>>>>> at etc etc etc.
>>>>>> ... 31 more
>>>>>> Caused by: org.xml.sax.SAXParseException: The content of element
>>>>>> type "subclass" must match
>>>>>> " (meta*,tuplizer*,synchronize*,(property|many-to-one|one-to-o ne|component|dynamic-component|any|map|set|list|bag|idbag|ar ray|primitive-array)*,join*,subclass*,loader?,sql-insert?,sq l-update?,sql-delete?,resultset*,(query|sql-query)*) ".
>>>>>>
>>>>>> at
>>>>>> com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper. createSAXParseException(ErrorHandlerWrapper.java:236)
>>>>>>
>>>>>> .... etc etc etc
>>>>>>
>>>>>> The section in question is attached.
>>>>>>
>>>>>>
>>>>>> My current setup is: Teneo 0.75, EMF2.2, Hibernate 3.2
>>>>>>
>>>>>> Any help greatly appreciated.
>>>>>>
>>>>>> Duncan
>>>>>>
>>>>>>
>>>>>> ------------------------------------------------------------ ------------
>>>>>>
>>>>>>
>>>>>> <subclass entity-name="Identifiable" abstract="true" lazy="false"
>>>>>> extends="Annotable" discriminator-value="Identifiable">
>>>>>> <meta attribute="eclassName">Identifiable</meta>
>>>>>> <meta
>>>>>> attribute="epackage">http://www.sdmx.org/resources/infomodel/1.0/base.xmi</meta>
>>>>>>
>>>>>> <id name="urn" type="java.lang.String">
>>>>>> <column not-null="true" unique="false" name="`urn`"/>
>>>>>> </id>
>>>>>> <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="id" lazy="false" insert="true"
>>>>>> update="true" not-null="false" unique="false"
>>>>>> type="java.lang.String">
>>>>>> <column not-null="false" unique="false" name="`id`"/>
>>>>>> </property>
>>>>>> <property name="uri" lazy="false" insert="true"
>>>>>> update="true" not-null="false" unique="false"
>>>>>> type="java.lang.String">
>>>>>> <column not-null="false" unique="false" name="`uri`"/>
>>>>>> </property>
>>>>>> <many-to-one name="Name" entity-name="InternationalString"
>>>>>> cascade="all" lazy="false" insert="true" update="true"
>>>>>> not-null="false">
>>>>>> <column not-null="false" unique="false"
>>>>>> name="`internationalstring_name_e_id`"/>
>>>>>> </many-to-one>
>>>>>> <many-to-one name="Description"
>>>>>> entity-name="InternationalString" cascade="all" lazy="false"
>>>>>> insert="true" update="true" not-null="false">
>>>>>> <column not-null="false" unique="false"
>>>>>> name="`internationalstring_description_e_id`"/>
>>>>>> </many-to-one>
>>>>>> </subclass>
>>>>>
>>>>>
>>
>>
Re: [Teneo] Invalid subclass tag in hibernate mapping file . [message #603316 is a reply to message #74403] Thu, 08 March 2007 17:54 Go to previous message
Martin Taal is currently offline Martin TaalFriend
Messages: 5468
Registered: July 2009
Senior Member
Yes this seems to be a bug. Can you enter a bugzilla for this and attach the ecore files to that? If
you don't want to have your model publically accessible you can also send the ecores to me directly.

gr. Martin

Duncan ALexander wrote:
> Hi,
> im having an issue with my hibernate mapping file as generated by
> teneo. The issue seems to be an <id> and <version> tags which have been
> inserted below a <subclass> tag. I don't believe this is allowed and Im
> getting an error when attempting to use the config file of the form:
>
>
> org.hibernate.InvalidMappingException: Could not parse mapping document
> from resource hibernate_sdmx_config.xml
> at org.hibernate.cfg.Configuration.addResource(Configuration.ja va:569)
> at etc etc etc.
> ... 31 more
> Caused by: org.xml.sax.SAXParseException: The content of element type
> "subclass" must match
> " (meta*,tuplizer*,synchronize*,(property|many-to-one|one-to-o ne|component|dynamic-component|any|map|set|list|bag|idbag|ar ray|primitive-array)*,join*,subclass*,loader?,sql-insert?,sq l-update?,sql-delete?,resultset*,(query|sql-query)*) ".
>
> at
> com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper. createSAXParseException(ErrorHandlerWrapper.java:236)
>
> .... etc etc etc
>
> The section in question is attached.
>
>
> My current setup is: Teneo 0.75, EMF2.2, Hibernate 3.2
>
> Any help greatly appreciated.
>
> Duncan
>
>
> ------------------------------------------------------------ ------------
>
> <subclass entity-name="Identifiable" abstract="true" lazy="false" extends="Annotable" discriminator-value="Identifiable">
> <meta attribute="eclassName">Identifiable</meta>
> <meta attribute="epackage">http://www.sdmx.org/resources/infomodel/1.0/base.xmi</meta>
> <id name="urn" type="java.lang.String">
> <column not-null="true" unique="false" name="`urn`"/>
> </id>
> <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="id" lazy="false" insert="true" update="true" not-null="false" unique="false" type="java.lang.String">
> <column not-null="false" unique="false" name="`id`"/>
> </property>
> <property name="uri" lazy="false" insert="true" update="true" not-null="false" unique="false" type="java.lang.String">
> <column not-null="false" unique="false" name="`uri`"/>
> </property>
> <many-to-one name="Name" entity-name="InternationalString" cascade="all" lazy="false" insert="true" update="true" not-null="false">
> <column not-null="false" unique="false" name="`internationalstring_name_e_id`"/>
> </many-to-one>
> <many-to-one name="Description" entity-name="InternationalString" cascade="all" lazy="false" insert="true" update="true" not-null="false">
> <column not-null="false" unique="false" name="`internationalstring_description_e_id`"/>
> </many-to-one>
> </subclass>


--

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] Invalid subclass tag in hibernate mapping file . [message #603355 is a reply to message #74421] Fri, 09 March 2007 14:11 Go to previous message
Duncan Alexander is currently offline Duncan AlexanderFriend
Messages: 90
Registered: July 2009
Member
Hi
Bug added as No: 176821

ECore files mailed directly to you (Martin).

regards

Duncan

Martin Taal wrote:
> Yes this seems to be a bug. Can you enter a bugzilla for this and attach
> the ecore files to that? If you don't want to have your model publically
> accessible you can also send the ecores to me directly.
>
> gr. Martin
>
> Duncan ALexander wrote:
>> Hi,
>> im having an issue with my hibernate mapping file as generated by
>> teneo. The issue seems to be an <id> and <version> tags which have
>> been inserted below a <subclass> tag. I don't believe this is allowed
>> and Im getting an error when attempting to use the config file of the
>> form:
>>
>>
>> org.hibernate.InvalidMappingException: Could not parse mapping
>> document from resource hibernate_sdmx_config.xml
>> at
>> org.hibernate.cfg.Configuration.addResource(Configuration.ja va:569)
>> at etc etc etc.
>> ... 31 more
>> Caused by: org.xml.sax.SAXParseException: The content of element type
>> "subclass" must match
>> " (meta*,tuplizer*,synchronize*,(property|many-to-one|one-to-o ne|component|dynamic-component|any|map|set|list|bag|idbag|ar ray|primitive-array)*,join*,subclass*,loader?,sql-insert?,sq l-update?,sql-delete?,resultset*,(query|sql-query)*) ".
>>
>> at
>> com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper. createSAXParseException(ErrorHandlerWrapper.java:236)
>>
>> .... etc etc etc
>>
>> The section in question is attached.
>>
>>
>> My current setup is: Teneo 0.75, EMF2.2, Hibernate 3.2
>>
>> Any help greatly appreciated.
>>
>> Duncan
>>
>>
>> ------------------------------------------------------------ ------------
>>
>> <subclass entity-name="Identifiable" abstract="true" lazy="false"
>> extends="Annotable" discriminator-value="Identifiable">
>> <meta attribute="eclassName">Identifiable</meta>
>> <meta
>> attribute="epackage">http://www.sdmx.org/resources/infomodel/1.0/base.xmi</meta>
>>
>> <id name="urn" type="java.lang.String">
>> <column not-null="true" unique="false" name="`urn`"/>
>> </id>
>> <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="id" lazy="false" insert="true" update="true"
>> not-null="false" unique="false" type="java.lang.String">
>> <column not-null="false" unique="false" name="`id`"/>
>> </property>
>> <property name="uri" lazy="false" insert="true" update="true"
>> not-null="false" unique="false" type="java.lang.String">
>> <column not-null="false" unique="false" name="`uri`"/>
>> </property>
>> <many-to-one name="Name" entity-name="InternationalString"
>> cascade="all" lazy="false" insert="true" update="true" not-null="false">
>> <column not-null="false" unique="false"
>> name="`internationalstring_name_e_id`"/>
>> </many-to-one>
>> <many-to-one name="Description"
>> entity-name="InternationalString" cascade="all" lazy="false"
>> insert="true" update="true" not-null="false">
>> <column not-null="false" unique="false"
>> name="`internationalstring_description_e_id`"/>
>> </many-to-one>
>> </subclass>
>
>
Re: [Teneo] Invalid subclass tag in hibernate mapping file . [message #603438 is a reply to message #74600] Sun, 11 March 2007 16:22 Go to previous message
Duncan Alexander is currently offline Duncan AlexanderFriend
Messages: 90
Registered: July 2009
Member
Hi Martin,
with regard to your answer in Bugzilla (below)

note: Im generating my ecore from a Rose model.

Is it possible to mark something as a MappedSuperclass within a Rose model or would the actual
..ecore file need to be updated to reflect the new annotation or does Teneo also look at the code
generated from the .ecore file where it would be able to see any additional annotations ?

I've done a fair bit of digging before asking this question as I thought I would be able to work it
out but I'm afraid I hit a blank.

regards

Duncan

------- Comment #1 From Martin taal 2007-03-09 12:59:02 [reply] -------

Hi,
I checked the ecore files and the Identifiable has an efeature (urn) with the
id property (in ecore) set to true). This means that this efeature is mapped as
the id. Teneo does this eventhough it is a subclass (it is considered to be the
designers responsibility to assign id's only to the root of the inheritance
structure).
There is an option (PersistenceOptions.ID_FEATURE_AS_PRIMARY_KEY) to control if
Teneo should use the id=true efeatures as the pk. You can set this to false.
Another approach could be to map the annotatable as a @MappedSuperclass.

Let me know if this answers this issue.

gr. Martin

-----------



Duncan ALexander wrote:
> Hi
> Bug added as No: 176821
>
> ECore files mailed directly to you (Martin).
>
> regards
>
> Duncan
>
> Martin Taal wrote:
>> Yes this seems to be a bug. Can you enter a bugzilla for this and
>> attach the ecore files to that? If you don't want to have your model
>> publically accessible you can also send the ecores to me directly.
>>
>> gr. Martin
>>
>> Duncan ALexander wrote:
>>> Hi,
>>> im having an issue with my hibernate mapping file as generated by
>>> teneo. The issue seems to be an <id> and <version> tags which have
>>> been inserted below a <subclass> tag. I don't believe this is allowed
>>> and Im getting an error when attempting to use the config file of the
>>> form:
>>>
>>>
>>> org.hibernate.InvalidMappingException: Could not parse mapping
>>> document from resource hibernate_sdmx_config.xml
>>> at
>>> org.hibernate.cfg.Configuration.addResource(Configuration.ja va:569)
>>> at etc etc etc.
>>> ... 31 more
>>> Caused by: org.xml.sax.SAXParseException: The content of element type
>>> "subclass" must match
>>> " (meta*,tuplizer*,synchronize*,(property|many-to-one|one-to-o ne|component|dynamic-component|any|map|set|list|bag|idbag|ar ray|primitive-array)*,join*,subclass*,loader?,sql-insert?,sq l-update?,sql-delete?,resultset*,(query|sql-query)*) ".
>>>
>>> at
>>> com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper. createSAXParseException(ErrorHandlerWrapper.java:236)
>>>
>>> .... etc etc etc
>>>
>>> The section in question is attached.
>>>
>>>
>>> My current setup is: Teneo 0.75, EMF2.2, Hibernate 3.2
>>>
>>> Any help greatly appreciated.
>>>
>>> Duncan
>>>
>>>
>>> ------------------------------------------------------------ ------------
>>>
>>> <subclass entity-name="Identifiable" abstract="true" lazy="false"
>>> extends="Annotable" discriminator-value="Identifiable">
>>> <meta attribute="eclassName">Identifiable</meta>
>>> <meta
>>> attribute="epackage">http://www.sdmx.org/resources/infomodel/1.0/base.xmi</meta>
>>>
>>> <id name="urn" type="java.lang.String">
>>> <column not-null="true" unique="false" name="`urn`"/>
>>> </id>
>>> <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="id" lazy="false" insert="true" update="true"
>>> not-null="false" unique="false" type="java.lang.String">
>>> <column not-null="false" unique="false" name="`id`"/>
>>> </property>
>>> <property name="uri" lazy="false" insert="true" update="true"
>>> not-null="false" unique="false" type="java.lang.String">
>>> <column not-null="false" unique="false" name="`uri`"/>
>>> </property>
>>> <many-to-one name="Name" entity-name="InternationalString"
>>> cascade="all" lazy="false" insert="true" update="true" not-null="false">
>>> <column not-null="false" unique="false"
>>> name="`internationalstring_name_e_id`"/>
>>> </many-to-one>
>>> <many-to-one name="Description"
>>> entity-name="InternationalString" cascade="all" lazy="false"
>>> insert="true" update="true" not-null="false">
>>> <column not-null="false" unique="false"
>>> name="`internationalstring_description_e_id`"/>
>>> </many-to-one>
>>> </subclass>
>>
>>
Re: [Teneo] Invalid subclass tag in hibernate mapping file . [message #603442 is a reply to message #74906] Sun, 11 March 2007 16:32 Go to previous message
Martin Taal is currently offline Martin TaalFriend
Messages: 5468
Registered: July 2009
Senior Member
Hi Duncan,
You can enter a @MappedSuperClass annotation in Rose. I don't know how to do this though, maybe
searching on the emf newsgroup gives the answer. Otherwise you can ask there how to do that.

You can also specify jpa annotations in a separate xml file so that you don't need to adapt the
ecore (or Rose) itself:
http://www.elver.org/hibernate/ejb3_format.html#xml
(see that I need to edit this part of the website, it mentions jpoxdatastore, should be hbdatastore).

gr. Martin

Duncan ALexander wrote:
> Hi Martin,
> with regard to your answer in Bugzilla (below)
>
> note: Im generating my ecore from a Rose model.
>
> Is it possible to mark something as a MappedSuperclass within a Rose
> model or would the actual ..ecore file need to be updated to reflect the
> new annotation or does Teneo also look at the code generated from the
> .ecore file where it would be able to see any additional annotations ?
>
> I've done a fair bit of digging before asking this question as I thought
> I would be able to work it out but I'm afraid I hit a blank.
>
> regards
>
> Duncan
>
> ------- Comment #1 From Martin taal 2007-03-09 12:59:02 [reply] -------
>
> Hi,
> I checked the ecore files and the Identifiable has an efeature (urn)
> with the
> id property (in ecore) set to true). This means that this efeature is
> mapped as
> the id. Teneo does this eventhough it is a subclass (it is considered to
> be the
> designers responsibility to assign id's only to the root of the inheritance
> structure).
> There is an option (PersistenceOptions.ID_FEATURE_AS_PRIMARY_KEY) to
> control if
> Teneo should use the id=true efeatures as the pk. You can set this to
> false.
> Another approach could be to map the annotatable as a @MappedSuperclass.
>
> Let me know if this answers this issue.
>
> gr. Martin
>
> -----------
>
>
>
> Duncan ALexander wrote:
>> Hi
>> Bug added as No: 176821
>>
>> ECore files mailed directly to you (Martin).
>>
>> regards
>>
>> Duncan
>>
>> Martin Taal wrote:
>>> Yes this seems to be a bug. Can you enter a bugzilla for this and
>>> attach the ecore files to that? If you don't want to have your model
>>> publically accessible you can also send the ecores to me directly.
>>>
>>> gr. Martin
>>>
>>> Duncan ALexander wrote:
>>>> Hi,
>>>> im having an issue with my hibernate mapping file as generated by
>>>> teneo. The issue seems to be an <id> and <version> tags which have
>>>> been inserted below a <subclass> tag. I don't believe this is
>>>> allowed and Im getting an error when attempting to use the config
>>>> file of the form:
>>>>
>>>>
>>>> org.hibernate.InvalidMappingException: Could not parse mapping
>>>> document from resource hibernate_sdmx_config.xml
>>>> at
>>>> org.hibernate.cfg.Configuration.addResource(Configuration.ja va:569)
>>>> at etc etc etc.
>>>> ... 31 more
>>>> Caused by: org.xml.sax.SAXParseException: The content of element
>>>> type "subclass" must match
>>>> " (meta*,tuplizer*,synchronize*,(property|many-to-one|one-to-o ne|component|dynamic-component|any|map|set|list|bag|idbag|ar ray|primitive-array)*,join*,subclass*,loader?,sql-insert?,sq l-update?,sql-delete?,resultset*,(query|sql-query)*) ".
>>>>
>>>> at
>>>> com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper. createSAXParseException(ErrorHandlerWrapper.java:236)
>>>>
>>>> .... etc etc etc
>>>>
>>>> The section in question is attached.
>>>>
>>>>
>>>> My current setup is: Teneo 0.75, EMF2.2, Hibernate 3.2
>>>>
>>>> Any help greatly appreciated.
>>>>
>>>> Duncan
>>>>
>>>>
>>>> ------------------------------------------------------------ ------------
>>>>
>>>>
>>>> <subclass entity-name="Identifiable" abstract="true" lazy="false"
>>>> extends="Annotable" discriminator-value="Identifiable">
>>>> <meta attribute="eclassName">Identifiable</meta>
>>>> <meta
>>>> attribute="epackage">http://www.sdmx.org/resources/infomodel/1.0/base.xmi</meta>
>>>>
>>>> <id name="urn" type="java.lang.String">
>>>> <column not-null="true" unique="false" name="`urn`"/>
>>>> </id>
>>>> <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="id" lazy="false" insert="true" update="true"
>>>> not-null="false" unique="false" type="java.lang.String">
>>>> <column not-null="false" unique="false" name="`id`"/>
>>>> </property>
>>>> <property name="uri" lazy="false" insert="true"
>>>> update="true" not-null="false" unique="false" type="java.lang.String">
>>>> <column not-null="false" unique="false" name="`uri`"/>
>>>> </property>
>>>> <many-to-one name="Name" entity-name="InternationalString"
>>>> cascade="all" lazy="false" insert="true" update="true"
>>>> not-null="false">
>>>> <column not-null="false" unique="false"
>>>> name="`internationalstring_name_e_id`"/>
>>>> </many-to-one>
>>>> <many-to-one name="Description"
>>>> entity-name="InternationalString" cascade="all" lazy="false"
>>>> insert="true" update="true" not-null="false">
>>>> <column not-null="false" unique="false"
>>>> name="`internationalstring_description_e_id`"/>
>>>> </many-to-one>
>>>> </subclass>
>>>
>>>


--

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] Invalid subclass tag in hibernate mapping file . [message #603462 is a reply to message #74920] Sun, 11 March 2007 17:45 Go to previous message
Duncan Alexander is currently offline Duncan AlexanderFriend
Messages: 90
Registered: July 2009
Member
Hi Martin,
As I cant find any clear info on the newsgroups on how to add the MappedSuperClass annotation to
the Rose model I think it would be easier to add it directly to the generated .ecore
file...or....should I be adding it to the generated java file ?

Is it Teneo that will be checking for this annotation (as opposed to Hibernate) and if so
what format would the annotation have in an .ecore file ?

I assume that it would look like this in the ecore:

<eAnnotations source="http://someURLOrAnother">
<details key="MappedSuperClass" value="true"/>
</eAnnotations>



Duncan

Martin Taal wrote:
> Hi Duncan,
> You can enter a @MappedSuperClass annotation in Rose. I don't know how
> to do this though, maybe searching on the emf newsgroup gives the
> answer. Otherwise you can ask there how to do that.
>
> You can also specify jpa annotations in a separate xml file so that you
> don't need to adapt the ecore (or Rose) itself:
> http://www.elver.org/hibernate/ejb3_format.html#xml
> (see that I need to edit this part of the website, it mentions
> jpoxdatastore, should be hbdatastore).
>
> gr. Martin
>
> Duncan ALexander wrote:
>> Hi Martin,
>> with regard to your answer in Bugzilla (below)
>>
>> note: Im generating my ecore from a Rose model.
>>
>> Is it possible to mark something as a MappedSuperclass within a Rose
>> model or would the actual ..ecore file need to be updated to reflect
>> the new annotation or does Teneo also look at the code generated from
>> the .ecore file where it would be able to see any additional
>> annotations ?
>>
>> I've done a fair bit of digging before asking this question as I
>> thought I would be able to work it out but I'm afraid I hit a blank.
>>
>> regards
>>
>> Duncan
>>
>> ------- Comment #1 From Martin taal 2007-03-09 12:59:02 [reply]
>> -------
>>
>> Hi,
>> I checked the ecore files and the Identifiable has an efeature (urn)
>> with the
>> id property (in ecore) set to true). This means that this efeature is
>> mapped as
>> the id. Teneo does this eventhough it is a subclass (it is considered
>> to be the
>> designers responsibility to assign id's only to the root of the
>> inheritance
>> structure).
>> There is an option (PersistenceOptions.ID_FEATURE_AS_PRIMARY_KEY) to
>> control if
>> Teneo should use the id=true efeatures as the pk. You can set this to
>> false.
>> Another approach could be to map the annotatable as a @MappedSuperclass.
>>
>> Let me know if this answers this issue.
>>
>> gr. Martin
>>
>> -----------
>>
>>
>>
>> Duncan ALexander wrote:
>>> Hi
>>> Bug added as No: 176821
>>>
>>> ECore files mailed directly to you (Martin).
>>>
>>> regards
>>>
>>> Duncan
>>>
>>> Martin Taal wrote:
>>>> Yes this seems to be a bug. Can you enter a bugzilla for this and
>>>> attach the ecore files to that? If you don't want to have your model
>>>> publically accessible you can also send the ecores to me directly.
>>>>
>>>> gr. Martin
>>>>
>>>> Duncan ALexander wrote:
>>>>> Hi,
>>>>> im having an issue with my hibernate mapping file as generated
>>>>> by teneo. The issue seems to be an <id> and <version> tags which
>>>>> have been inserted below a <subclass> tag. I don't believe this is
>>>>> allowed and Im getting an error when attempting to use the config
>>>>> file of the form:
>>>>>
>>>>>
>>>>> org.hibernate.InvalidMappingException: Could not parse mapping
>>>>> document from resource hibernate_sdmx_config.xml
>>>>> at
>>>>> org.hibernate.cfg.Configuration.addResource(Configuration.ja va:569)
>>>>> at etc etc etc.
>>>>> ... 31 more
>>>>> Caused by: org.xml.sax.SAXParseException: The content of element
>>>>> type "subclass" must match
>>>>> " (meta*,tuplizer*,synchronize*,(property|many-to-one|one-to-o ne|component|dynamic-component|any|map|set|list|bag|idbag|ar ray|primitive-array)*,join*,subclass*,loader?,sql-insert?,sq l-update?,sql-delete?,resultset*,(query|sql-query)*) ".
>>>>>
>>>>> at
>>>>> com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper. createSAXParseException(ErrorHandlerWrapper.java:236)
>>>>>
>>>>> .... etc etc etc
>>>>>
>>>>> The section in question is attached.
>>>>>
>>>>>
>>>>> My current setup is: Teneo 0.75, EMF2.2, Hibernate 3.2
>>>>>
>>>>> Any help greatly appreciated.
>>>>>
>>>>> Duncan
>>>>>
>>>>>
>>>>> ------------------------------------------------------------ ------------
>>>>>
>>>>>
>>>>> <subclass entity-name="Identifiable" abstract="true" lazy="false"
>>>>> extends="Annotable" discriminator-value="Identifiable">
>>>>> <meta attribute="eclassName">Identifiable</meta>
>>>>> <meta
>>>>> attribute="epackage">http://www.sdmx.org/resources/infomodel/1.0/base.xmi</meta>
>>>>>
>>>>> <id name="urn" type="java.lang.String">
>>>>> <column not-null="true" unique="false" name="`urn`"/>
>>>>> </id>
>>>>> <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="id" lazy="false" insert="true"
>>>>> update="true" not-null="false" unique="false" type="java.lang.String">
>>>>> <column not-null="false" unique="false" name="`id`"/>
>>>>> </property>
>>>>> <property name="uri" lazy="false" insert="true"
>>>>> update="true" not-null="false" unique="false" type="java.lang.String">
>>>>> <column not-null="false" unique="false" name="`uri`"/>
>>>>> </property>
>>>>> <many-to-one name="Name" entity-name="InternationalString"
>>>>> cascade="all" lazy="false" insert="true" update="true"
>>>>> not-null="false">
>>>>> <column not-null="false" unique="false"
>>>>> name="`internationalstring_name_e_id`"/>
>>>>> </many-to-one>
>>>>> <many-to-one name="Description"
>>>>> entity-name="InternationalString" cascade="all" lazy="false"
>>>>> insert="true" update="true" not-null="false">
>>>>> <column not-null="false" unique="false"
>>>>> name="`internationalstring_description_e_id`"/>
>>>>> </many-to-one>
>>>>> </subclass>
>>>>
>>>>
>
>
Re: [Teneo] Invalid subclass tag in hibernate mapping file . [message #603468 is a reply to message #74954] Sun, 11 March 2007 18:30 Go to previous message
Duncan Alexander is currently offline Duncan AlexanderFriend
Messages: 90
Registered: July 2009
Member
Actually,
I just found this in the eclipse newsgroups which I believe explains the format annotations should
have in the .ecore file.

http://dev.eclipse.org/newslists/news.eclipse.technology.emf t/msg01342.html

Ill try this out first.

thanks Martin for your assistance.

Duncan

Duncan ALexander wrote:
> Hi Martin,
> As I cant find any clear info on the newsgroups on how to add the
> MappedSuperClass annotation to the Rose model I think it would be easier
> to add it directly to the generated .ecore file...or....should I be
> adding it to the generated java file ?
>
> Is it Teneo that will be checking for this annotation (as opposed to
> Hibernate) and if so
> what format would the annotation have in an .ecore file ?
>
> I assume that it would look like this in the ecore:
>
> <eAnnotations source="http://someURLOrAnother">
> <details key="MappedSuperClass" value="true"/>
> </eAnnotations>
>
>
>
> Duncan
>
> Martin Taal wrote:
>> Hi Duncan,
>> You can enter a @MappedSuperClass annotation in Rose. I don't know how
>> to do this though, maybe searching on the emf newsgroup gives the
>> answer. Otherwise you can ask there how to do that.
>>
>> You can also specify jpa annotations in a separate xml file so that
>> you don't need to adapt the ecore (or Rose) itself:
>> http://www.elver.org/hibernate/ejb3_format.html#xml
>> (see that I need to edit this part of the website, it mentions
>> jpoxdatastore, should be hbdatastore).
>>
>> gr. Martin
>>
>> Duncan ALexander wrote:
>>> Hi Martin,
>>> with regard to your answer in Bugzilla (below)
>>>
>>> note: Im generating my ecore from a Rose model.
>>>
>>> Is it possible to mark something as a MappedSuperclass within a Rose
>>> model or would the actual ..ecore file need to be updated to reflect
>>> the new annotation or does Teneo also look at the code generated from
>>> the .ecore file where it would be able to see any additional
>>> annotations ?
>>>
>>> I've done a fair bit of digging before asking this question as I
>>> thought I would be able to work it out but I'm afraid I hit a blank.
>>>
>>> regards
>>>
>>> Duncan
>>>
>>> ------- Comment #1 From Martin taal 2007-03-09 12:59:02 [reply]
>>> -------
>>>
>>> Hi,
>>> I checked the ecore files and the Identifiable has an efeature (urn)
>>> with the
>>> id property (in ecore) set to true). This means that this efeature is
>>> mapped as
>>> the id. Teneo does this eventhough it is a subclass (it is considered
>>> to be the
>>> designers responsibility to assign id's only to the root of the
>>> inheritance
>>> structure).
>>> There is an option (PersistenceOptions.ID_FEATURE_AS_PRIMARY_KEY) to
>>> control if
>>> Teneo should use the id=true efeatures as the pk. You can set this to
>>> false.
>>> Another approach could be to map the annotatable as a @MappedSuperclass.
>>>
>>> Let me know if this answers this issue.
>>>
>>> gr. Martin
>>>
>>> -----------
>>>
>>>
>>>
>>> Duncan ALexander wrote:
>>>> Hi
>>>> Bug added as No: 176821
>>>>
>>>> ECore files mailed directly to you (Martin).
>>>>
>>>> regards
>>>>
>>>> Duncan
>>>>
>>>> Martin Taal wrote:
>>>>> Yes this seems to be a bug. Can you enter a bugzilla for this and
>>>>> attach the ecore files to that? If you don't want to have your
>>>>> model publically accessible you can also send the ecores to me
>>>>> directly.
>>>>>
>>>>> gr. Martin
>>>>>
>>>>> Duncan ALexander wrote:
>>>>>> Hi,
>>>>>> im having an issue with my hibernate mapping file as generated
>>>>>> by teneo. The issue seems to be an <id> and <version> tags which
>>>>>> have been inserted below a <subclass> tag. I don't believe this is
>>>>>> allowed and Im getting an error when attempting to use the config
>>>>>> file of the form:
>>>>>>
>>>>>>
>>>>>> org.hibernate.InvalidMappingException: Could not parse mapping
>>>>>> document from resource hibernate_sdmx_config.xml
>>>>>> at
>>>>>> org.hibernate.cfg.Configuration.addResource(Configuration.ja va:569)
>>>>>> at etc etc etc.
>>>>>> ... 31 more
>>>>>> Caused by: org.xml.sax.SAXParseException: The content of element
>>>>>> type "subclass" must match
>>>>>> " (meta*,tuplizer*,synchronize*,(property|many-to-one|one-to-o ne|component|dynamic-component|any|map|set|list|bag|idbag|ar ray|primitive-array)*,join*,subclass*,loader?,sql-insert?,sq l-update?,sql-delete?,resultset*,(query|sql-query)*) ".
>>>>>>
>>>>>> at
>>>>>> com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper. createSAXParseException(ErrorHandlerWrapper.java:236)
>>>>>>
>>>>>> .... etc etc etc
>>>>>>
>>>>>> The section in question is attached.
>>>>>>
>>>>>>
>>>>>> My current setup is: Teneo 0.75, EMF2.2, Hibernate 3.2
>>>>>>
>>>>>> Any help greatly appreciated.
>>>>>>
>>>>>> Duncan
>>>>>>
>>>>>>
>>>>>> ------------------------------------------------------------ ------------
>>>>>>
>>>>>>
>>>>>> <subclass entity-name="Identifiable" abstract="true" lazy="false"
>>>>>> extends="Annotable" discriminator-value="Identifiable">
>>>>>> <meta attribute="eclassName">Identifiable</meta>
>>>>>> <meta
>>>>>> attribute="epackage">http://www.sdmx.org/resources/infomodel/1.0/base.xmi</meta>
>>>>>>
>>>>>> <id name="urn" type="java.lang.String">
>>>>>> <column not-null="true" unique="false" name="`urn`"/>
>>>>>> </id>
>>>>>> <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="id" lazy="false" insert="true"
>>>>>> update="true" not-null="false" unique="false"
>>>>>> type="java.lang.String">
>>>>>> <column not-null="false" unique="false" name="`id`"/>
>>>>>> </property>
>>>>>> <property name="uri" lazy="false" insert="true"
>>>>>> update="true" not-null="false" unique="false"
>>>>>> type="java.lang.String">
>>>>>> <column not-null="false" unique="false" name="`uri`"/>
>>>>>> </property>
>>>>>> <many-to-one name="Name" entity-name="InternationalString"
>>>>>> cascade="all" lazy="false" insert="true" update="true"
>>>>>> not-null="false">
>>>>>> <column not-null="false" unique="false"
>>>>>> name="`internationalstring_name_e_id`"/>
>>>>>> </many-to-one>
>>>>>> <many-to-one name="Description"
>>>>>> entity-name="InternationalString" cascade="all" lazy="false"
>>>>>> insert="true" update="true" not-null="false">
>>>>>> <column not-null="false" unique="false"
>>>>>> name="`internationalstring_description_e_id`"/>
>>>>>> </many-to-one>
>>>>>> </subclass>
>>>>>
>>>>>
>>
>>
Previous Topic:EMaps and the missing @MapKey annotation
Next Topic:[Teneo] Duplicate entity name problem in hibernate mapping file.
Goto Forum:
  


Current Time: Thu Dec 03 01:27:05 GMT 2020

Powered by FUDForum. Page generated in 0.02519 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top