I've got following query:
select * from situation s where s.version =
(select max(ss.version) from situation ss where ss.situationKey = s.situationKey)
And I'd like to encode it as Torque's Criteria. The main problem here is that the subquery is linked with the main query by situationKey. I didn't find such case anywhere documented, is it possible to do this query in Torque?
Your query seems to reference the outer select from the inner select. You might have to add an alias to do that. Not sure but Torque does have the nested select capability.