Hi,
I got a question concerning the order insert querys are executed when I got a class with various one-to many relationships to other classes. For example lets say I got the class person, and this class has one-to-one relationship with the class address, and one-to-many relationship with the class subscription. Every time I save a new person is there any way to know/or especify which table, address or subscription, is going to be populated first?
hibernate mapping example:
Code:
<class name="Person" table="PERSON">
<id name="Id" type="Int32" column="PERSON_ID">
<generator class="identity" />
</id>
<property name="Name" column="NAME" />
<one-to-one name="Adress" class="Adress"/>
<set name="PersonSubscriptions" >
<key column="PERSON_ID" />
<one-to-many class="Subscriptions"/>
</set>
</class>
<class name="Adress" table="PERSON_ADRESS">
<id name="Id" column="ID">
<generator class="foreign">
<param name="property">Person</param>
</generator>
</id>
<one-to-one name="Person" class="Person" constrained="true" fetch="join"/>
<property name="Street" column="STREET" />
...
</class>
<class name="Subscriptions" table="PERSON_SUBSCRIPTIONS">
<composite-id name="Id" class="SubscriptionId">
<key-property name="PersonId" column="PERSON_ID"/>
<key-property name="SubscriptionId" column="SUBS_ID"/>
</composite-id>
<property name="Description" column="DESCRIPTION"/>
...
</class>
In this case can I somehow especify that PERSON_SUBSCRIPTIONS is populated before PERSON_ADRESS when I save the class Person?
Thanks