-->
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: Possible to programmatically create subquery using Critera?
PostPosted: Tue Mar 02, 2004 1:12 pm 
Regular
Regular

Joined: Tue Dec 02, 2003 6:25 pm
Posts: 61
Location: Dallas, TX
I'm using Hibernate 2.1 and am writing a query/filter interface for our app. I'm using the Criteria object and Expression factory to build the query programmatically.

There are a couple of places where I need to do subqueries, but I can't figure out how.

I'm trying to take an HQL query like this (which works great) and build it programmatically:

Code:
select from SpecialServicing ss where

ss.assetStatus in (

   select elements(g.statuses) from StatusGroup as g where g.id  in (11,12)

)

and ss.assetManager.id in ( 14)



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.