--
You received this message because you are subscribed to the Google Groups "nhusers" group.
To post to this group, send email to nhu...@googlegroups.com.
To unsubscribe from this group, send email to nhusers+u...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/nhusers?hl=en.
Without knowing why you want this, maybe this thread http://community.jboss.org/message/567412 (the thread is true also for NHibernate Envers) can give you some understanding about this.
/Roger
________________________________
Från: nhu...@googlegroups.com [nhu...@googlegroups.com] för Fabio Maulo [fabio...@gmail.com]
Skickat: den 14 mars 2011 18:54
Till: nhu...@googlegroups.com
Ämne: Re: [nhusers] Envers and parent / child relationship
Envers is not about "single entity version", it is about "whole domain state version".
The REV in Envers is like the revision in SVN.
A revision is about the state of the whole domain under audit.
On Mon, Mar 14, 2011 at 1:08 PM, Chris Richards <chris.r...@yellowfeather.co.uk<mailto:chris.r...@yellowfeather.co.uk>> wrote:
Using Envers, if I have a parent / child relationship is it possible
to up the version of the parent entity if a property on a child entity
is modified? For example, if I had a Quote parent entity with a
collection of QuoteDetail child entities, when a property on a
QuoteDetail is modified then both QuoteDetail and the parent Quote
have their revision number updated.
--
You received this message because you are subscribed to the Google Groups "nhusers" group.
To post to this group, send email to nhu...@googlegroups.com<mailto:nhu...@googlegroups.com>.
To unsubscribe from this group, send email to nhusers+u...@googlegroups.com<mailto:nhusers%2Bunsu...@googlegroups.com>.
If Envers would offer an API like your proposal, I would guess it wouldn't take long before it ain't enough... Probably someone needs q.Detail.DetailInfo to be included as well -> you need to be able to define a big tree of entities. I will think about this...
Anyhow, even today you should probably be able to do what you want if you get the revisions for your quote entity followed by a query (queries ?) to get appropriate revisions for quotedetails. Have a look at https://bitbucket.org/RogerKratz/nhibernate.envers/src/9ecad0c2289a/Src/NHibernate.Envers.Tests/Integration/Query/RevisionConstraintQueryTest.cs.
Then you will have all affected revisions for Quote and QuoteDetails.
I don't say this is optimal though. A first good step for this situation would be to port audit strategy (http://216.121.112.228/browse/NHE-1) which gives the user the possibility not only persist an audit date but also an end date. That way queries like this would be easier. I hope I will find the time for this port "soon" (day, week or month - don't know ;)).
/Roger