I need to get last record and the main record of one-to-many
relation with Hibernate criteria. The Pseudo-Sql show the query I want to execute
Table1(Master)
Table2(Details)
Select *
from Table1 tab1, Table2 tab2
where tab2.tab1id == tab1.id
and tab2.date == ( select Max(date)
from table2 where table2.tab1id == tab1.id)