Hibernate advanced select
We want to get a row from a开发者_Python百科 table using Hibernate a la:
select max(id) from mytable where date = <date>
- Then
select * from mytable where id = <max_id>
We are currently using Hibernate to map mytable
to Java domain objects.
I know how to load the domain object based on an id. So I could just do #1 using JDBC and then load the domain object using Hibernate the "normal" way.
But.. is there a way to do this with one single Hibernate logical query?
Try using subqueries.
精彩评论