-->
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.  [ 3 posts ] 
Author Message
 Post subject: Working with historical data.
PostPosted: Mon Aug 04, 2008 9:50 am 
Newbie

Joined: Mon Aug 04, 2008 9:48 am
Posts: 3
Hey guys! I want to know if there are any possibilities to work with historical data in hibernate? For example, I have an entity Credit.

class Credit{

String name;
}

Thus in database I have a corresponding table lets say credit that contains information about credits.

I want to tell hibernate that my entity Credit is actually historical entity and I need another table in database like credit_history that will be containing information about credit plus for example some additional data. In the way I see it, my entity should look like this:

@HistoryTable("credit_history")
class Credit {

String name;

@Historical
Date date;

}

Notice that I need just one entity for two different tables. First table just contains information about credit and the other one these information plus data.
Are there any possibilities I can do something like that?


Top
 Profile  
 
 Post subject:
PostPosted: Tue Aug 05, 2008 9:43 am 
Newbie

Joined: Mon Aug 04, 2008 9:48 am
Posts: 3
Simpler Task. How can I force Hibernate to create one more table for me? Lets say I have class User which has annotation @Entity, so hibernate will create table in database for that entity. Can I do something like

createOneMoreTable("user_history", User.class) and hibernate creates one more table according already annotated class User. It will be the same table but with different name.


Top
 Profile  
 
 Post subject: Entity versioning
PostPosted: Tue Aug 05, 2008 9:46 am 
Newbie

Joined: Thu Mar 27, 2008 10:50 am
Posts: 13
For entity versioning (keeping historical information) check out http://www.jboss.org/envers


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 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.