-->
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: Multiple Data Bases SQL Server 2000
PostPosted: Tue May 23, 2006 9:52 am 
Newbie

Joined: Tue May 23, 2006 9:45 am
Posts: 1
Location: Brasil
Hi!!!

I need to implement a data access layer in a existent solution, but I cant change the data base model at this moment. My trooble is the existence of 6 difents data bases and in each one there are tables what I need make "Selects" wich "Unions" to extrat a simple information.

Can I, using nHibernate, make a mapping point to 2 or more tables in diferents data bases?

thanks for help and sorry for my bad English.
Nilton


Top
 Profile  
 
 Post subject:
PostPosted: Tue May 23, 2006 12:00 pm 
Expert
Expert

Joined: Fri May 13, 2005 5:56 pm
Posts: 308
Location: Santa Barbara, California, USA
as long as the databases are running in the same instance of SQL server, you can map objects across databases by using the fully qualified table name:

Code:
<class name="MyClass">
    ...
    <property name="PhoneNumber" column="MyDatabase.MyTable.PhoneNumber" />
    <property name="Example" column="MyOtherDatabase.MyOtherTable.MyColumn">
    ...
</class>


check here for more info:

http://forum.hibernate.org/viewtopic.ph ... +databases


Top
 Profile  
 
 Post subject:
PostPosted: Tue May 23, 2006 4:59 pm 
Senior
Senior

Joined: Wed Jun 15, 2005 4:17 am
Posts: 156
I think the correct syntax would be:

Code:
MyDatabase.owner.TableName.ColumnName


or without owner:

Code:
MyDatabase..TableName.ColumName


cheers,
Radu


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.