-->
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: Can't get scrolling to work with together with an eager join
PostPosted: Tue Mar 17, 2009 9:19 pm 
Newbie

Joined: Fri Oct 14, 2005 9:55 am
Posts: 5
Location: Bergen, Norway
Hibernate version: 3.2.6
Mapping:

parent entity:
Code:
<class="parent" class="Parent">

        <many-to-one name="child3" class="child3" fetch="select">
            <column name="PFILE_DIRECT_FILE" />
        </many-to-one>

.....
<set name="child1s" inverse="true">
            <key>
                <column name="PAMSG_MESSAGE_ID" not-null="true" />
            </key>
            <one-to-many class="Child1" />
        </set>
        <set name="child2s" inverse="true">
            <key>
                <column name="PAMSG_MESSAGE_ID" not-null="true" />
            </key>
            <one-to-many class="Child2" />
        </set>
.....
</class>


Query:
Integer fileId = 1; //parameter in dao
ScrollableResults scrollableResults = session.createCriteria( Tpwpamsg.class )
                    .add( Restrictions.eq( "child3.pfileFileId", fileId ) )
                    .setResultTransformer( CriteriaSpecification.DISTINCT_ROOT_ENTITY )
                    .setFetchMode( "child1s", FetchMode.JOIN )
                    .setFetchMode( "childe2s", FetchMode.JOIN )
                    .scroll( ScrollMode.FORWARD_ONLY );
               
                return scrollableResults;


I expected this to return a disctinct scrollable result of parent entities, but they are in fact duplicated!? Why so?
Code:


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.