Hello,
I have a class called Process that contains an Account. This Accountdata is part of the Processtable. So I made up a Component.
When I create an Process, I load an Account from the Database an put it into the Process. This way, i copie the Accountdata into the Process for history-reasons.
Now I have the Problem, that the Account I am puttint into the Process can either be DAccount or any subclass OR KAccount or any subclass.
After saving the Process, the information of which class this Account was has gone.
Is there any way to keep that Classinformation. For example the same way as it is done with the Discriminator in ClassMapping?
Thx,
Alexander
Hibernate version:3.1
Mapping documents:
Code:
<hibernate-mapping>
<class name="de.datentraum.allrounder.Processes.Process" table="process" abstract="true" discriminator-value="PROC">
<id name="id" type="int" column="process_id" unsaved-value="0">
<generator class="sequence">
<param name="sequence">uid_process</param>
</generator>
</id>
<discriminator column="disc"/>
<property name="strMemo" column="memo" type="text"/>
<set name="documents">
<key column="process_id"/>
<one-to-many class="de.datentraum.allrounder.Processes.Document"/>
</set>
<component name="account" class="de.datentraum.allrounder.BaseClasses.Account" lazy="false">
<property name="accountnumber"/>
<property name="id" column="account_id"/>
<property name="condition" column="accountcondition" type="int"/>
<many-to-one name="partner" column="partner_id" class="de.datentraum.allrounder.BaseClasses.Partner" />
</component>
<subclass name="de.datentraum.allrounder.Processes.DProcess" discriminator-value="DPRO">
</subclass>
<subclass name="de.datentraum.allrounder.Processes.KProcess" discriminator-value="KPRO">
</subclass>
</class>
</hibernate-mapping>