-->
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.  [ 3 posts ] 
Author Message
 Post subject: Entity versioning
PostPosted: Wed Oct 01, 2008 2:54 pm 
Newbie

Joined: Wed Oct 01, 2008 10:36 am
Posts: 3
Hi, I'm new to NHibernate and this forum so go easy...

I have setup versioning and it's working. I now have to fulfil a requirement that all versions of the entities are saved in the database, so it will be possible to "roll back" to a previous version of the entity.

NHibernate only increments the version number as far as I can tell. How can I make the versioning create a new row?

This needs to deal with the fact that the entities have child relationships too.

Thanks,
Jonty


Top
 Profile  
 
 Post subject:
PostPosted: Thu Oct 02, 2008 7:26 am 
Newbie

Joined: Wed Oct 01, 2008 10:36 am
Posts: 3
Is this actually something that NHibernate deals with? If not, can anyone share their implementation? It must be a fairly common scenario.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Oct 02, 2008 8:29 am 
Expert
Expert

Joined: Thu Dec 14, 2006 5:57 am
Posts: 1185
Location: Zurich, Switzerland
Hibernate's versioning and audit/change tracking are completely different approaches. You can use an Interceptor for the latter:

http://www.hibernate.org/318.html

It's for hibernate but it shows the idea. With NHibernate 2.0 you'll probably are better of with using the event system. Checkout the documentation about NH 2.0

http://www.nhforge.org/wikis/reference2-0en/default.aspx

_________________
--Wolfgang


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 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.