-->
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: A quesiton on system design with Hibernate
PostPosted: Sat May 13, 2006 12:16 am 
Newbie

Joined: Sat May 13, 2006 12:10 am
Posts: 2
This question is about system design with Hibernate (or to say ORM, generally).

Applications often need to keep the change history of business objects. Take an issue-traking system for example. In an issue-tracking system, each step of the issue-processing should be recorded, e.g., when the issue was to set to "acknowledged" status by whom, when the issue was set to "assigned" status by whom and so on...

A well-accepted solution to this on database level is to use two tables in the database:
-One table holds the basic properties of the business object which are supposed to be not changeable, e.g., business IDs etc.(let's call this table basic property table). The primary key is business object ID (an artificial key)
-The other table holds other properties which may be changed often (let's call it extended property table). It has a joint primary key property-id and has the business object id as foreign key.

When properties in "basic property table" are changed, the corresponding record is UPDATED. When properties in "extended property table" are changed, a new record is INSERTED in to the extended property table with a timestamp.

And sometimes, more than one "extended property table" is needed...

The question is: how to design the mapping schema for this kind of requirements?


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.