-->
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.  [ 3 posts ] 
Author Message
 Post subject: Hi Freinds,Problem in simple Join query
PostPosted: Wed May 02, 2007 3:59 am 
Beginner
Beginner

Joined: Thu Apr 12, 2007 12:04 pm
Posts: 25
Location: Chennai
Hi friends,

Here is one Sql Query:-

SqlQuery==>SELECT O.*, P.* FROM ORDERS O, PRODUCT P WHERE O.ORDER_ID=P.ORDER_ID;

And the Hibernate query for it is==>


List orders = session.createCriteria(Order.class)
.setFetchMode(“products”,FetchMode.JOIN)
.list();




Could u plz tell me that whats the first parameter of setFetchMode(). According to one manual which i got, the first parameter is known as String AssociationPath.

But i couldnt understand what does it mean.

Could u plz put more focus on it.

Thanks Alot.
With High Regards
Saurav Jain

_________________
I Really want to share my knowledge and learn from you all people specaily about Hibernate.. Thanks Lot


Top
 Profile  
 
 Post subject:
PostPosted: Wed May 02, 2007 6:28 am 
Expert
Expert

Joined: Tue Jan 30, 2007 12:45 am
Posts: 283
Location: India
Hi intimate2talent,

Represents an association fetching strategy. This is used together with the Criteria API to specify runtime fetching strategies

static FetchMode DEFAULT
Default to the setting configured in the mapping file.
static FetchMode EAGER
Deprecated. use FetchMode.JOIN
static FetchMode JOIN
Fetch using an outer join.
static FetchMode LAZY
Deprecated. use FetchMode.SELECT
static FetchMode SELECT
Fetch eagerly, using a separate select.

I think this would give you more clarity.

_________________
Dharmendra Pandey


Top
 Profile  
 
 Post subject: It is the name of your property
PostPosted: Wed May 02, 2007 7:38 am 
Regular
Regular

Joined: Wed Aug 24, 2005 11:49 am
Posts: 63
"products" is how you mapped the association.

_________________
Edwin van der Elst
Finalist IT Group


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