-->
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.  [ 4 posts ] 
Author Message
 Post subject: subselect on many-to-one
PostPosted: Thu Nov 15, 2007 2:57 pm 
Newbie

Joined: Wed Feb 01, 2006 10:16 am
Posts: 13
Hibernate version:
3.2.0.cr1


Hello il would like to optimize my sql 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

Thanks for your help


Top
 Profile  
 
 Post subject:
PostPosted: Mon Nov 19, 2007 1:37 pm 
Expert
Expert

Joined: Sat Jan 17, 2004 2:57 pm
Posts: 329
Location: In the basement in my underwear
subselect doesn't make sense in this case. A many to one will be loaded via an outer join or a simple select. Are you thinking maybe of a one-to-many mapping, that has support for subselect.

_________________
Some people are like Slinkies - not really good for anything, but you still can't help but smile when you see one tumble down the stairs.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Dec 13, 2007 7:14 am 
Newbie

Joined: Wed Feb 01, 2006 10:16 am
Posts: 13
delete


Last edited by pioug on Thu Dec 13, 2007 7:18 am, edited 2 times in total.

Top
 Profile  
 
 Post subject: optimize lazy many-to-one access
PostPosted: Thu Dec 13, 2007 7:15 am 
Newbie

Joined: Wed Feb 01, 2006 10:16 am
Posts: 13
Hello

I don't like to use fetch join & select on many-to-one property

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
Sorry for my English


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 4 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.