Hi,
i try to map a list of dependent objects which can be different classes. The mapped dependent object is abstract.
Example:
<class name="container">
[...]
<list name="content" table="container_content">
<key column="container_id"/>
<composite-element class="AbstractContent" abstract="true">
<discriminator column="type" type="char"/>
<property name="name"/>
<subclass name="ContentA">
</subclass>
<subclass name="ContentB">
<property name="test"/>
</subclass>
</composite-element>
</list>
</class>
I think this should create a table:
container_content (container_id,type,name,test)
Instead i get a table:
container_content (container_id,type)
When i try to save such a "container" with some content, a get an InstantiationException because hibernate tries to insantiate the AbstractContent class.
I played around with many parameters (e.g. lazy="false") with no success.
Anyone who can help me?
Edit: I use hibernate 3.0.2.
|