-->
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.  [ 1 post ] 
Author Message
 Post subject: joining tables
PostPosted: Sun Dec 30, 2012 7:32 am 
Newbie

Joined: Fri Feb 15, 2008 11:21 am
Posts: 3
Hello *,

I have two tables that are one2one by means of id columns. I need to join them, filter by a field value in tab2, order by a field value in tab1, but then I need only tab1 results. If I use:

Code:
"from tab1 a, tab2 b where b.parent = 0 order by a.name"


I get a List<Object[]> as a result. However I need only tab1 rows, tab2 is included only because of the "where" clause. I'd like to have a List<Tab1> result instead. Is that possible or am I forced to run two different queries?

_________________
Virtual Bit di Lucio Crusca
http://www.virtual-bit.com


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

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.