Duplicate properties appearing in subclass. [message #603727] |
Tue, 20 March 2007 08:25 |
Eclipse User |
|
|
|
Hi,
I am having an issue whereby a subclass in my Teneo generated hibernate mapping appears to be
duplicating the properties of a superclass. When attempting to initialise the database with the
mapping it throws an error :
Exception in thread "main" org.hibernate.MappingException: Repeated column in mapping for entity:
kf.CodedXSMeasure column: xsattachdataset (should be mapped with insert="false" update="false")
at org.hibernate.mapping.PersistentClass.checkColumnDuplication (PersistentClass.java:652)
at org.hibernate.mapping.PersistentClass.checkPropertyColumnDup lication(PersistentClass.java:674)
at org.hibernate.mapping.PersistentClass.checkColumnDuplication (PersistentClass.java:696)
The ecore generated from my model appears to be correct in that there is no duplication, it only
appears after generating the hibernate mapping. The classes are UncodedMeasure and CodedMeasure.
UncodedMeasure is generated correctly, but CodedMeasure is not.
My ecore looks like this:
<eClassifiers xsi:type="ecore:EClass" name="UncodedMeasure" eSuperTypes="#//Measure
base.ecore#//Codable"/>
<eClassifiers xsi:type="ecore:EClass" name="CodedMeasure" eSuperTypes="#//Measure
base.ecore#//Codable"/>
But my generated hibernate mapping comes out as:
<subclass entity-name="UncodedMeasure" abstract="false" lazy="false" extends="Measure"
discriminator-value="UncodedMeasure">
<meta attribute="eclassName">UncodedMeasure</meta>
<meta attribute="epackage">http://www.sdmx.org/resources/infomodel/1.0/keyfamily.xmi</meta>
</subclass>
<subclass entity-name="CodedMeasure" abstract="false" lazy="false" extends="Measure"
discriminator-value="CodedMeasure">
<meta attribute="eclassName">CodedMeasure</meta>
<meta attribute="epackage">http://www.sdmx.org/resources/infomodel/1.0/keyfamily.xmi</meta>
<property name="xsAttachDataset" lazy="false" insert="true" update="true" not-null="false"
unique="false" type="java.lang.Boolean">
<column not-null="false" unique="false" name="`xsattachdataset`"/>
</property>
<property name="xsAttachGroup" lazy="false" insert="true" update="true" not-null="false"
unique="false" type="java.lang.Boolean">
<column not-null="false" unique="false" name="`xsattachgroup`"/>
</property>
<property name="xsAttachSection" lazy="false" insert="true" update="true" not-null="false"
unique="false" type="java.lang.Boolean">
<column not-null="false" unique="false" name="`xsattachsection`"/>
</property>
<property name="xsAttachObservation" lazy="false" insert="true" update="true" not-null="false"
unique="false" type="java.lang.Boolean">
<column not-null="false" unique="false" name="`xsattachobservation`"/>
</property>
<property name="timeFormat" lazy="false" insert="true" update="true" not-null="false"
unique="false" type="java.lang.Boolean">
<column not-null="false" unique="false" name="`timeformat`"/>
</property>
<many-to-one name="CodeList" entity-name="ItemScheme"
cascade="merge,persist,save-update,lock,refresh" lazy="false" insert="true" update="true"
not-null="false">
<column not-null="false" unique="false" name="`itemscheme_codelist_urn`"/>
</many-to-one>
</subclass>
The properties which are mapped under CodedMeasure should not be there as they form part of a class
further up the heirarchy and there is nothing in the ecore to indicate that the two classes should
be mapped differently. They do normally have some other differentiating features but I have stripped
them out to highlight the problem.
regards
Duncan
|
|
|
Powered by
FUDForum. Page generated in 0.03080 seconds