0
用普通的SQL:集团通过为JPA
select e.*
from (
select type, source, max(timestamp) as maxtimestamp
from handelse
group by type, source
) other join event e
on e.type=other.type and
e.source=other.source and
e.timestamp = other.maxtimestamp
join eventpost ep on e.id = ep.event_id;
的事件记录了最新的时间戳。有趣的是,JPA不允许在from子句中进行子选择。任何想法如何重新将查询写入JPA可以吞咽的东西?底层数据库是Oracle。