-->
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: Future-dated entities and collection membership
PostPosted: Tue Jun 21, 2011 1:39 pm 
Newbie

Joined: Mon Sep 05, 2005 10:52 pm
Posts: 6
Hi all,

I'm working through a redesign of our system that will involve future-effective dating some entities. I am aware of using a filter for effective-date entity queries in general, and also the existence of Hibernate Envers (which I plan to use). But, in the case of a revision of an entity that's supposed to become effective in the future, wouldn't that involve creating a new entity instance, with a new ID? How would I then ensure that this entity, with a new ID, replaces the old entity instance in any collections? See below for the ubiquitous Employee / Department example:

An Employee A, entity ID 1, has a name, with effective from & to values of, let's say 1/1/2011 to 12/31/9999 (infinite). That Employee is a member of a Department entity's employees collection.

I go to set that Employee's name today, 6/21/2011, to change to something else, effective 7/1/2011. So, at least as I understand it, I would create a copy of Employee A, entity ID 2, effective 7/1/2011 to 12/31/9999, and set ID 1's effective end date to 6/30/2011.

Aside from somehow knowing in my Employee DAO that I have to add that new entry, ID 2, to all collections of Employees... How would this be handled?

I guess effective dating filters and Envers are great for handling revisions that occurred in the past, since those revisions would all have the same entity ID value. But what about revisions that are supposed to take effect in the future some time?

Thanks!


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.