-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: Envers, retrieve entity by an embedded property
PostPosted: Mon Feb 17, 2014 12:37 pm 
Newbie

Joined: Tue Jan 03, 2006 5:09 pm
Posts: 4
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


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.