I'm trying to recover all version from a entity, but my code all ways returns only 1 version, this is the way i'm doing it now.
return AuditReaderFactory.get(super.getEntityManager())
.createQuery()
.forEntitiesAtRevision(BitacoraControl.class, bitacoraControlId.intValue())
.add(AuditEntity.id().eq(bitacoraControlId))
.addOrder(AuditEntity.revisionNumber().asc())
.getResultList()
;
forEntitiesAtRevision
retrieves an entity matching the conditions at a specific revision - hence you get at most one result.You should probably use
forRevisionsOfEntity
, to get a list of revisions of a specific entity.