-->
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.  [ 2 posts ] 
Author Message
 Post subject: subselect on many-to-one
PostPosted: Sat Jan 05, 2008 10:03 pm 
Newbie

Joined: Wed Feb 01, 2006 10:16 am
Posts: 13
Hello il would like to optimize my queries with subselect fetch.

this declaration didn't work

<many-to-one name="*" class="*" fetch="subselect">

And i don't like to use join fetch

Example
Person --> many-to-one --> Adress


When you select n Persons (1 select) and get Adress for Each Person (n Select)

for 50 Persons got 51 queries

with subselect

select many Person (1 select) and on first access of property Adress (1 select)

for 50 Persons got 2 queries

Thanks


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jan 07, 2008 4:30 pm 
Expert
Expert

Joined: Mon Nov 26, 2007 2:29 pm
Posts: 443
Pioug,

I believe you have to specify the fetching strategy on the "one" side of a collection definition, not on the "many-to-one" side.

_________________
Gonzalo Díaz


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

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.