hi!
searched the web but didn't find anything that could help me.
here's the story (see xml on bottom):
i get many objects (for instance MegaSpeise) through a webservice, but the functionality is not enough so i have to extend these objects to gain my new objects (f.i. SpecialSpeise).
because i do not want to map all these files to my new objects (wrapper) i want to save the parentobjects to DB and "convert" it to concrete objects if needed.
i wrote a test where i added a MegaSpeise and then a SpecialSpeise.
after that i try to getAll() and logged the output.
i set the discriminator to the same values, and i guessed to get back one of the objects (MegaSpeise or SpecialSpeise) but still hibernate achieves it to differ between the MegaSpeise and the SpecialSpeise.
any suggestions? isn't the discriminator meant to determine which instance hibernate should create? (i also tried full classpath (f.i. both discr. set to entity.SpecialSpeise))
best wishes and thanks in advance
chris
<class name="entity.Speise">
<id name="id"><generator class="native" /></id>
<property name="..." />
<discriminator column="discriminator" type="string" length="1" />
<subclass name="entity.MegaSpeise" discriminator-value="S">
<property name="..." />
</subclass>
<subclass name="entity.SpecialSpeise" discriminator-value="S">
<property name="..." />
</subclass>
</class>
|