-->
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 - Revisionnr of update is not saved in audit table
PostPosted: Fri Aug 19, 2011 5:42 am 
Newbie

Joined: Fri Aug 19, 2011 4:36 am
Posts: 2
Location: Germany
Hi everybody,

i have one problem with the audit entries generated by envers for a simple unidirectional 1-n relationship(e.g. A to B).
the owning side(A) holds a list of Bs which is annotated as follow
Code:
@OneToMany(cascade={CascadeType.ALL})
Both A and B are audited on class level with @Audited.

Context:
- when i persist B-objects by adding them to the list in A(e.g. A.getB().add(newB)) then commit, the revisionnr(1) is saved for all added Bs in B_AUD and also one entry in A_AUD for this transaction.
- same behavior occurs when i remove B-objects from the list in A(e.g. A.getB().remove(oldB)) => revision(2)

So far good.

Problem:
envers doesnt insert the revisionnr of the updates made to B-objects of the A-list when i do smthg like this:
Code:
B toMod = A.getB().get(1);
toMod.mod();

Then i commit the changes after its done. the new revisionnr(3) is present in B_AUD for all modified objects, but not in A_AUD. it seems like A isnt aware of the changes being made.

is this supported by envers at all? if yes, what im doing wrong? i really want to have just this one entry in A_AUD with the resivionnr of the update( and not 1 different revision in A_AUD for every change made in B. e.g if i modify 5 B-objects of the A-List, then there will be 5 different revisions in A_AUD for each change 1,2,3,4,5)

i hope my issue is comprehensible..every help will be appreciated.
TIA


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.