-->
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: Map one class into two different tables ...
PostPosted: Mon Jun 06, 2005 9:20 am 
Newbie

Joined: Wed Mar 02, 2005 1:28 pm
Posts: 4
This is a general question for which I havent gotten a satisfactory answer so far.
I have a class that depending on the context of my program I want to map it to a different table. Basically the scenarios would play out like this:
+Class A needs to be persisted into two different tables as follows:
+If the program is handling billing then Class A should be mapped into Table A1
+If the program is using the customer research component then Class A should be mapped into Table A2

Is my question clear? And if it is, is the above at all possible?
Thanks in advance for your help,
Jonatan


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jun 06, 2005 10:09 am 
Newbie

Joined: Mon Jun 06, 2005 9:38 am
Posts: 4
You could probably use the addResource or addClass method of the configuration object to set your mapping files and persist your object.

Not sure if this is what you are looking at.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jun 06, 2005 9:18 pm 
Beginner
Beginner

Joined: Sat May 07, 2005 12:01 pm
Posts: 33
Assign 2 different entity names in the mapping (see "entirty" attr), then use the specific entity name when you save the object.


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.