| 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
 
 
 |  |