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: Inheritance - Add a field to each descendant
PostPosted: Wed Sep 02, 2009 3:02 am 
Newbie

Joined: Thu Dec 11, 2008 4:58 pm
Posts: 2
Hi

I'm working with a few inherited classes and I have a abstract class as mapped super class. I work with inheritance strategy joined. The class inheritance looks like this: Person -> Employee -> XYEmployee. Everything works fine.

Now I want to add to every table in the DB a Field "lastModified" where I want to store the date of the last modification for each row. What is the best approach to do that? When I add the field in the superclass (Person), then I just have the columns in the direct descendants (Employee). I want the field in the table XYEmployee too.

Thank you


Top
 Profile  
 
 Post subject: Re: Inheritance - Add a field to each descendant
PostPosted: Wed Sep 02, 2009 6:39 am 
Expert
Expert

Joined: Tue May 13, 2008 3:42 pm
Posts: 919
Location: Toronto & Ajax Ontario www.hibernatemadeeasy.com
Check out the Envers project! It's part of Hibernate 3.5, but an add on currently. It'll help!

_________________
Cameron McKenzie - Author of "Hibernate Made Easy" and "What is WebSphere?"
http://www.TheBookOnHibernate.com Check out my 'easy to follow' Hibernate & JPA Tutorials


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.