-->
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: fetch join with alias
PostPosted: Wed Feb 11, 2004 10:12 am 
Regular
Regular

Joined: Tue Oct 14, 2003 11:11 pm
Posts: 62
Location: Brasil/Curitiba
I've read the documentation 10.3 about the fetch clause:

Quote:
A fetch join does not usually need to assign an alias, because the associated objects should not be used in the where clause (or any other clause). Also, the associated objects are not returned directly in the query results. Instead, they may be accessed via the parent object.


-> "fetch join does not usually need to assign an alias", but if I need of the fetch join in the where clause?

In my code I have a many-to-one association and I've defined a alias "secao" to the fetch join, because I must use it in a where clause, is this correct?

Code:
sb = new StringBuffer();
sb.append(" FROM BibliotecaHTMLVO AS html ");
sb.append(" INNER JOIN fetch html.secao as secao");
sb.append(" WHERE secao.titulo like ? ");


thanks

_________________
Ricardo Lecheta


Top
 Profile  
 
 Post subject:
PostPosted: Wed Feb 11, 2004 12:36 pm 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
I use that wo problem.

_________________
Emmanuel


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.