-->
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: How to re-index a List-association with list-index
PostPosted: Mon Sep 14, 2009 2:51 am 
Beginner
Beginner

Joined: Wed Dec 06, 2006 6:24 am
Posts: 24
Location: Bangalore
I have following relation

Parent having two Children Child1 and Child2.

Following is the sample mapping.

Code:
<class name="eg.Parent">
        <id name="id">
            <generator class="sequence"/>
        </id>
        <list name="childrenList1" lazy="true" cascade="all">
            <key column="parent_id"/>
            <index column="child_order"/>
            <one-to-many class="eg.Child1"/>
        </list>

       <list name="childrenList2" lazy="true" cascade="all">
            <key column="parent_id"/>
            <index column="child_order"/>
            <one-to-many class="eg.Child2"/>
        </list>
    </class>

    <class name="eg.Child1">
        <id name="id">
            <generator class="sequence"/>
        </id>
        <property name="name"/>
        <property name="childOrder" column="child_order" type="int" not-null="true" update="false"/>
        <many-to-one name="parent" class="eg.Parent" column="parent_id" not-null="true"/>
    </class>
<class name="eg.Child2">
        <id name="id">
            <generator class="sequence"/>
        </id>
        <property name="name"/>
        <property name="childOrder" column="child_order" type="int" not-null="true" update="false"/>
        <many-to-one name="parent" class="eg.Parent" column="parent_id" not-null="true"/>
    </class>


How can I re-index ChildList1, when I have deleted an Object of ChildList1 in the middle of the List through child1Dao.delete(Child1 obj) method call, without doing any operation on Parent.

Is it possible, please give your suggestions.

_________________
Vinay N


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:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.