-->
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: Question about design
PostPosted: Tue Sep 13, 2005 5:23 pm 
Newbie

Joined: Mon Jun 20, 2005 11:07 am
Posts: 16
Hi all. I am refactoring a existing application, where I have a Product class that stores mainly the stock (productName, creationDate, updateDate, amountStocked, minimumAmount and maximumAmount).
But now I have to store historics of some modifications(like, everytime that the stock of a product is modified, that modification goes to the historic). The problem is that I have to do historic storing the last value AND the date. For example, if the amountStocked is modified, the last amount have to be stored with the update date, linked to the product. I was thinking in something like a Set of a object that stores only the value(mostly Doubles) and the dates(java.util.Date) in Product class, but I don't know if this is the best approach. What are the best practices to do such things?

Thanks in advance and best regards to all

Rafael Mauricio Nami


Top
 Profile  
 
 Post subject:
PostPosted: Tue Sep 13, 2005 5:28 pm 
Regular
Regular

Joined: Sun May 08, 2005 2:48 am
Posts: 118
Location: United Kingdom
Maybe this is a good starting point using "interceptors" http://www.hibernate.org/195.html

Check out the appropiate Interceptor part of the manual.


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.