I have a query (below) that needs to pull the most recent activity by transactionId (FK in a transactions table).
The query works exactly how I want it, but when I try to use it in Hibernate I have trouble converting it over. I currently use the SQLQuery interface to run this, but I would like to use a criteria query though I can't seem to find any way to do it. The closest I've come was the <subselect> tag in the mapping file to attempt to create a view. I'm not seeing much documentation on this tag, and it's not totally clear how to use it or what I'm doing wrong. In fact, I'm not ever sure how to access/utilize the view via java after it's mapped properly (DetachedCritiera maybe?).
Can someone help understand how to use this subselect - and will it even do what I want it to?
Thank you in advance.