In RevisionsOfEntityQuery associationQueries are not added when list() method is called. TraverseRelation then doesnť work. Will it be ever added, please? Thank you.
Are you discussing relations of many-to-many and one-to-many? We have one-to-one and many-to-one support already and have the remaining planned as part of HHH-11735. If that isn't what you're referring to, please provide a test case or example of what it is you're asking.
I have three entities with OneToMany relation. Author -> Book -> BookEdition.
There is no problem to do this:
AuditQuery auditQuery = AuditReaderFactory.get(getCurrentSession()).createQuery().forEntitiesAtRevision(BookEdition.class, 1);
.traverseRelation("book", JoinType.INNER, "book")
.traverseRelation("author", JoinType.INNER, "author").up().up()
List<BookEdition> bookEditions = auditQuery.getResultList();
But when I want to do the same with forRevisionsOfEntity, it is not working, because alias for author doesn't exist.
AuditQuery auditQuery = AuditReaderFactory.get(getCurrentSession()).createQuery().forRevisionsOfEntity(BookEdition.class, false, false);
Thanks , that was intentional when we first implemented association queries. For this particular type of query, we have to address the obscure differences in the query result-set because the internal queries vary depending whether you specify to selectOnlyEntities=true vs selectOnlyEntities=false and how that impacts the association queries.
I'll tentatively place this in the 6.0 category and we'll try to include this in that major release.