【发布时间】:2019-12-13 09:42:36
【问题描述】:
我正在尝试选择我的每个 trackedResource 实体的最新版本,其中 position_source_feed_id 具有特定值。
我有一个功能性的 PostgreSQL 查询:
select tr0.*
from
trackedresource_aud tr0
where
tr0.position_source_feed_id='7870b8b9-4b98-4ea7-8fb8-99746d7f0e85'
and
tr0.rev=(
select
max(tr1.rev)
from
trackedresource_aud tr1
where
tr1.id=tr0.id
and
tr1.position_source_feed_id=tr0.position_source_feed_id
)
order by
tr0.rev desc
;
但我似乎无法匹配 AuditQuery。
当我尝试上面的 createNativeQuery 时,我得到:
javax.persistence.PersistenceException: org.hibernate.MappingException: No Dialect mapping for JDBC type: 1111
可能是因为实体上有几个 UUID 字段,包括 position_source_feed_id
【问题讨论】:
标签: sql hibernate spring-data-jpa hibernate-envers