-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: alter order tables are populated
PostPosted: Sat Mar 30, 2013 9:32 am 
Newbie

Joined: Sat Mar 30, 2013 8:58 am
Posts: 1
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


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
cron
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.