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: Query across schemas
PostPosted: Tue Feb 10, 2009 8:04 am 
Is it possible to connect two different schemas using NHibernate?
I want to query two tables, but in a different schema each one.

Tks


Top
  
 
 Post subject:
PostPosted: Tue Feb 10, 2009 12:37 pm 
Expert
Expert

Joined: Thu Dec 14, 2006 5:57 am
Posts: 1185
Location: Zurich, Switzerland
There's a schema attribute on the class tag:

<class name="Foo" table="footable" schema="bar" ... />

or you can put the schema in the tablename:

<class name="Foo" table="bar.footable" ... />

_________________
--Wolfgang


Top
 Profile  
 
 Post subject:
PostPosted: Tue Feb 10, 2009 12:45 pm 
Sorry, I did not get my problem well explained.

For example,

I have TABLE_A in two different schemas. The table has the same name.
I can't put the name of the schema directy on mapping file. It must be dynamic.

I start a session on a schema, and than when it's necessary to execute another query, in a different schema, I start another session on another schema.

[]s


Top
  
 
 Post subject:
PostPosted: Tue Feb 10, 2009 1:16 pm 
Expert
Expert

Joined: Thu Dec 14, 2006 5:57 am
Posts: 1185
Location: Zurich, Switzerland
Hmm, I don't think that's possible ... try and search the nhusers group at google:

http://groups.google.com/group/nhusers?hl=en

_________________
--Wolfgang


Top
 Profile  
 
 Post subject:
PostPosted: Tue Feb 10, 2009 1:17 pm 
Ok wolli.
Tks for your help


Top
  
 
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.