-->
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: How to select from a subquery with DetachedCriteria?
PostPosted: Thu Sep 26, 2013 4:40 am 
Newbie

Joined: Thu Sep 26, 2013 3:51 am
Posts: 1
Hi,
i need to build a sql statement using DetachedCriteria which has to look like this:

select id from (
select
table.ID as id
from
EXAMPLE_TABLE table
where table.PARAM = 1
order by table.TIMESTAMP desc
)
)

How can i do this? Or is it not possible with DetachedCriteria? I know how to create a subquery, but in a subquery i couldnt use the "order by", and that is necessary!


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.