Hi,
I am usind Hibernate 3.1.
I have one superclass. It has two subclasses and a component mapping. This should be mapped to one table.
It seems that this two mappings don't work together. Is there a reason for it? Is it not allowed to put them together.
The error lookes like this:
Error parsing XML: XML InputStream(196) The content of element type "class" must match "(meta*,subselect?,cache?,synchronize*,comment?,tuplizer*,
(id|composite-id),discriminator?,natural-id?,
(version|timestamp)?,
(property|many-to-one|one-to-one|component|dynamic-component|properties|any|map|set|list|bag|idbag|array|primitive-array)*,
((join*,subclass*)|joined-subclass*|union-subclass*),
loader?,sql-insert?,sql-update?,sql-delete?,filter*,resultset*,
(query|sql-query)*)"
As far as I understand this expression it isn't forbidden to use <subclass> and <component> in the same <class>
Both mappings <subclass> and <component> work without another, but they do not work together.
I hope somebody can help.
Greetings,
Jakob
Here is the Mapping:
<class name="Superclass"
discriminator-value="AA">
<id name="id" column="ID" type="integer">
<generator class="sequence" />
</id>
<discriminator
column="TYPE"
type="string" />
<subclass
name="Subclass1"
discriminator-value="GA">
<property name="attribute1" type="integer">
<column name="ATTRIBUTE1" not-null="true" />
</property>
<property name="a2" type="integer">
<column name="A2" not-null="true" />
</property>
<property name="a3" type="string">
<column name="A3" not-null="true" length="255" />
</property>
</subclass>
<subclass
name="Subclass2"
discriminator-value="TA">
<property name="a5" type="string">
<column name="a5" not-null="true" length="5000" />
</property>
</subclass>
<component
name="comp"
class="Comp">
<property name="x" type="integer">
<column name="X" not-null="true" />
</property>
<property name="y" type="integer">
<column name="Y" not-null="true" />
</property>
</component>
</class>
|