문제

I am trying to look up an object in my envers table, but I dont have the PK. Instead of the PK I have a field ("child") . This is my query,

List resultList = reader.createQuery().forRevisionsOfEntity(TP.class, false, true) .add(AuditEntity.property("child").eq(nodeid)).getResultList();

But I get this:

Caused by: org.hibernate.PropertyNotFoundException: field [id] not found on java.lang.Long

Or are there any chance of searching by custom fields for revisions?

Regards, Johann

도움이 되었습니까?

해결책

If child is a relation, than you need to use AuditEntity.relatedId("child").eq(nodeid). See also 15.7.1 in the docs

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top