-->
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: Hibernate Mapping file Modification
PostPosted: Mon Dec 17, 2007 9:06 am 
Newbie

Joined: Mon Dec 17, 2007 8:42 am
Posts: 2
Dear Experts,

We are developing ‘Issue Tracking’ product by using Hibernate. We have to handle multiple schema in our product. For example we have two schemas in our Database that are ‘Major’ and ‘Minor’. If the user age is below 18 then the corresponding user details should be stored in ‘Minor’ Schema, else in ‘Major’ Schema. To achieve this we have to change ‘Hibernate mapping file’ in run time.
Can any one help me?
And give some sample code for this.

Advance Thanks.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Dec 17, 2007 10:20 am 
Regular
Regular

Joined: Sat Nov 25, 2006 11:37 am
Posts: 72
Why do you need to modify the mapping file at runtime? Isn't all you need to create two session factories (or EntityManagerFactories if you use JPA) one for each database and then just use the correct factory to get your session object from based on the age of your user.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Dec 24, 2007 7:03 am 
Newbie

Joined: Mon Dec 17, 2007 8:42 am
Posts: 2
We are going to use single database with multiple schemas, that is our requirement. So can you tell me, is it possible to change the schema value at runtime? if so, can you explain me?


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.