-->
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: Hibernate ignoring fetch="select"
PostPosted: Thu Jan 12, 2006 5:03 pm 
Newbie

Joined: Wed Nov 23, 2005 1:09 pm
Posts: 6
Hibernate version:
3.1

Mapping documents:
<join table="POSTS_TEXT" fetch="select">
<key column="POST_ID"/>
<property name="subject" column="POST_SUBJECT" type="string" not-null="false" />
<property name="text" column="POST_TEXT" type="com.netg.forums.dao.hibernate.util.BlobType" not-null="true" />
</join>

The generated SQL (show_sql=true):
select
post0_.POST_ID as POST1_20_,
post0_.POSTER_IP as POSTER2_20_,
post0_.POST_TIME as POST3_20_,
post0_.POST_EDIT_COUNT as POST4_20_,
post0_.POST_EDIT_TIME as POST5_20_,
post0_.NEED_CONTENT_REVIEW as NEED6_20_,
post0_.CONTENT_REVIEWED as CONTENT7_20_,
post0_.NEED_MODERATE as NEED8_20_,
post0_.USER_ID as USER9_20_,
post0_.TOPIC_ID as TOPIC10_20_,
post0_1_.POST_SUBJECT as POST2_22_,
post0_1_.POST_TEXT as POST3_22_
from
POSTS post0_ inner join POSTS_TEXT post0_1_ on post0_.POST_ID=post0_1_.POST_ID
where
(post0_.USER_ID=? )

As you can see, hibernate is using inner join regardless of my specifying select in the mapping. Any ideas?


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jan 12, 2006 9:46 pm 
Expert
Expert

Joined: Thu Dec 23, 2004 9:08 pm
Posts: 2008
From the reference docs:

If set to select then Hibernate will use a sequential select for a <join> defined on a subclass, which will be issued only if a row turns out to represent an instance of the subclass. Inner joins will still be used to retrieve a <join> defined by the class and its superclasses.

fetch="select" on the <join> tag is a hint that is used only rarely.


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