-->
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: Hibernate - Creating Criteria
PostPosted: Fri Sep 12, 2008 2:00 am 
Newbie

Joined: Fri Sep 12, 2008 1:50 am
Posts: 2
hi all,

i want to know how to use an inner query in Criteria. i have set the values of the column and one condition requires that the column has the max version.

i want to create a query like this :

SELECT * FROM TABLE1
WHERE NAME='AD_JOB'
AND EVENT=1
AND JOBVERSION = (SELECT MAX(JOBVERSION) FROM TABLE1 WHERE NAME='AD_JOB')

i have criteria for setting name and event conditions. i am unaware of how to set for job version. plz do reply


Top
 Profile  
 
 Post subject:
PostPosted: Fri Sep 12, 2008 6:09 am 
Beginner
Beginner

Joined: Thu Nov 15, 2007 11:27 am
Posts: 34
Check detached criteria, if I remember well, you can handle sub query with it.


Top
 Profile  
 
 Post subject: Thanks
PostPosted: Fri Sep 12, 2008 6:33 am 
Newbie

Joined: Fri Sep 12, 2008 1:50 am
Posts: 2
Yoann56 wrote:
Check detached criteria, if I remember well, you can handle sub query with it.


Thanks buddy... DetachedCriteria solves the Problem!!!


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.