-->
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: Would it be possible to...
PostPosted: Tue Oct 30, 2007 5:20 pm 
Newbie

Joined: Fri Jun 16, 2006 11:53 am
Posts: 12
We're trying to find a way to do something (in the latest and greatest version of Hibernate), but have no idea if it is possible. Here is the situation:

AModel is:

Log that has a LogValue (an abstract class) that can be an IntLogValue, StringLogValue, etc., all mapped using joined inheritance.

BD therefore has the following tables:
Log
LogValue
IntLogValue
StringLogValue
etc...

All the IDs of these things are mapped using @Id @GeneratedValue

B-We want to archive logs to a secondary DB, then remove them from the primary one.

The basics work fine. We load the entities from DB 1, we reset the IDs, then save them to DB 2.

C-Problematic: we want for the IDs to be identical on DB 1 and DB 2.

D-The question: can we override the mapping on ID, to tell hibernate, in the second case, to use the values we have?

E-What we tried: create a subclass, that overrides ID field with no @GeneratedValue, but hibernate threw an exception telling us the mapping could not be overridden on the ID field.


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.