-->
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: HQL query nested select and Oracle
PostPosted: Tue Jul 24, 2007 11:10 am 
Newbie

Joined: Tue Jul 24, 2007 10:58 am
Posts: 1
I have the following HQL defined:

<query name="assignedBusinessLineHistory.by.userAccount.and.lastUpdated">

<![CDATA[
select assignedBusinessLineHistory
from StandardAssignedBusinessLineHistory assignedBusinessLineHistory
where assignedBusinessLineHistory.historyId in
(select max(updateHistory.historyId) as maxId
from StandardAssignedBusinessLineHistory updateHistory
where updateHistory.user.userId = :userId
and updateHistory.lastUpdated.dateTime <= :lastUpdated
group by updateHistory.id
)
order by assignedBusinessLineHistory.id
]]>

</query>


PROBLEM:

Attempting to provide a 'snaphot' of associations at some timestamp.

Instead of only grabbing the set of objects prior to the lastUpdated, it is retrieving all objects prior to the lastUpdated. It is as if the max() function is not working. I created a similar query for the only the inner select and experienced the same issue.

BACKGROUND:

Hibernate-Version: 3.0.5
Oracle 9.2


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.