-->
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.  [ 2 posts ] 
Author Message
 Post subject: Envers: how to figure out which field got changed
PostPosted: Thu Sep 08, 2016 6:16 am 
Newbie

Joined: Mon Jul 25, 2016 6:56 am
Posts: 2
Hello,

From the doc it's unclear how to figure out which field got changed in revision. On database level it's quite straightforward (after enabling org.hibernate.envers.global_with_modified_flag), but there doesn't seem to be an API which answers this question.
http://docs.jboss.org/hibernate/core/4. ... es-queries - this one suggests going in the loop over all existing fields/properties and asking "hasChanged". Seems very inefficient to me.

Or I'm missing something obvious?

WBR


Top
 Profile  
 
 Post subject: Re: Envers: how to figure out which field got changed
PostPosted: Thu Sep 08, 2016 11:46 am 
Hibernate Team
Hibernate Team

Joined: Wed Jun 15, 2016 9:04 am
Posts: 24
Unfortunately out of the box, there isn't an API specifically for that, but there is a JIRA issue (https://hibernate.atlassian.net/browse/HHH-8058) to enable such support.

What I believe we need is an API that allows specifying the entity type and primary key along with a range of revisions, either provided as a collection or a start/end revision specifying a range. The API would return a difference/changes object that enables obtaining the revised property names and values between all the provided revision numbers.

Otherwise, query cache may be helpful here to minimize any type of performance concerns in the short-term.


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

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.