-->
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.  [ 2 posts ] 
Author Message
 Post subject: Multiple Database Question
PostPosted: Fri Jan 18, 2008 3:22 pm 
Newbie

Joined: Mon Jul 23, 2007 11:58 am
Posts: 15
Location: New Jersey
Hi Guys/Gals,

I am kind of new to hibernate, and I want to ask what I feel to be a simple question.

I have an application that needs to make use of 2 separate sybase database residing on the same server. I would like my persistent class Foo to be mapped to a table in database X. Foo would also have a property Bar that is a one-to-one relationship backed by a persistent class mapped to database Y. What is the best way to achieve this? Is there a such thing as perhaps a schema attribute on a mapped class?

Let me know if the problem is not clear.

Thanks in advance for the help.

-Roy


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jan 18, 2008 4:07 pm 
Expert
Expert

Joined: Mon Nov 26, 2007 2:29 pm
Posts: 443
The only place I know of where you specify "schema" as a property, is in the "default_schema".
This means that you specify the schema configuration level, and that you get different sessionfactories/sessions per different configuration.

You can also specify a different schema per mapping file/class. Tou can map the same class to 2 different schemas, changing both the default schema and the entity name (which usually defaults to the class name).

_________________
Gonzalo Díaz


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