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: Store History As We Save
PostPosted: Sat Sep 13, 2008 1:58 pm 
Beginner
Beginner

Joined: Thu Jul 31, 2008 8:28 pm
Posts: 24
Hello, I would like to suggest an idea and tell me what you think:
I have a database with two tables: Objects and Characteristic (off course I have more tables but they are not relevant here).

I would like that every time I change characteristic of an object to save a history record of the change.

I wonder what is the best way to do that in terms of database and NHibernate.
For example, I can save the history in the same table and have a Version column which will be 0 (zero) for the current value.
I can use separate table for the history only.

For NHibernate I can have objects represent the history (which I think is the better way) or I can use interceptor to populate the history table each time Characteristic object is changed.

What do you think?


Top
 Profile  
 
 Post subject:
PostPosted: Tue Sep 16, 2008 12:01 pm 
Regular
Regular

Joined: Tue Oct 16, 2007 9:45 am
Posts: 93
Auditing is a an aspect and should not be part of your domain. I would use Spring.net framework to create an aspect and apply it the the desired operation.


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.