-->
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.  [ 5 posts ] 
Author Message
 Post subject: Historical Sessions
PostPosted: Mon Jan 15, 2007 8:34 am 
Newbie

Joined: Tue Jun 14, 2005 6:41 am
Posts: 10
Hi.

Has anyone implemented something similar to TopLink Historical Sessions, http://www.oracle.com/technology/produc ... sun006.htm using Hibernate?

Example usage: http://www.oracle.com/technology/produc ... m#BJFEBFJI

Thanks,

/Magnus


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jan 15, 2007 8:41 am 
Newbie

Joined: Tue Jun 14, 2005 6:41 am
Posts: 10
Forgot to post this link that describes the behaviour I'm looking for. Isolated cache separate from global cache, frozen data etc.

http://www.oracle.com/technology/produc ... AsOfClause)


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jan 15, 2007 9:23 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
look into Hibernate 3 filters

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jan 15, 2007 10:16 am 
Newbie

Joined: Tue Jun 14, 2005 6:41 am
Posts: 10
What about mapping historical instances to a different table?

http://www.oracle.com/technology/produc ... m#BCGJJBEH

I can configure Oracle to maintain a _HIST table using triggers. I then can configure TopLink to read historical entries from this table, transparently to the application. The application reads the same entity, not knowing if it comes from the current or history table. (One table only contains current rows, and one table contains all rows with row_start, row_end columns.)

Using Hibernate, afaik, I need to have 2 entities? Or can I have Hibernate map "Person" to "TABLE_PERSON", oracle trigger to populate "TABLE_PERSON_HIST", and then read it using toplink through the same entity. Toplink knows where to find it.

/Magnus


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jan 15, 2007 10:41 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
map the same class but with a different entityname.

e.g. <class name="Person" table="PERSON"> ....

and <class name="Person" entity-name="HistoricalPerson" table="PERSON_HIST"> ....

Having it done fully transparently across multiple tables is not something we have had requests for before.

_________________
Max
Don't forget to rate


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