Hello,
Just wanted a quick opinion whether or not this is a bug that should be logged in jira, or perhaps someone has a solution. Currently entities are being retrieved by an embedded property with multiple properties, saying for example in hql "WHERE fileReference = :fileReference" and hibernate translates it to sql saying: "WHERE fileName = '...' AND extension = '...' when the model looks like this:
Code:
@Embeddable
FileReference {
String fileName;
String extension;
}
@Entity
FileEntry {
@Embedded
FileReference fileReference;
String source;
User addedBy;
}
So far, so great, and everything is working as expected.
Now we wanted to do the same thing with envers, the FileEntry is @Audited, but when doing something like:
Code:
AuditQuery auditQuery = auditReaderFactory.getAuditReader().createQuery().
forEntitiesAtRevision(entityType, revision.getId())
.add(AuditEntity.property("fileReference").eq(ourFileReference));
it blows up and says:
"could not resolve property: fileReference of: some.packages.model.FileEntry_h"
also tried with individual fields of fileReference like fileName, but keep getting the same message.
I have a feeling that envers is not correctly querying by an embeddable, or am I doing it wrong?
Thanks