-->
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.  [ 1 post ] 
Author Message
 Post subject: New to nHibernate... Multiple database schemas and mappings?
PostPosted: Mon Apr 05, 2010 2:21 pm 
Newbie

Joined: Mon Apr 05, 2010 2:11 pm
Posts: 1
Hi,
I have been toying with NH for a few days and I love it! Great stuff.
I am currently facing a problem for which I could not find any help online and I was hoping to get some help in here.
I created a business model with some basic classes such as Person (Id, FirstName, LastName, HomeAddress and WorkAddress) and Address (City, State, Zip, Country, Line1, Line2), used by the first for the xxxAddress properties.

I am trying to create two sets of mapping files to map 2 DBs that have a very different structure.

In the 1st DB, the properties of the 2 addresses are in the MASTNAME table (=Persons table) and I've got the address mapping easily using "component".

In the 2nd DB things are more complicated. Addresses are in a different table, countries in another table and so is City. Essentially, each of the 2 addresses need to get some data from 3 tables, using an integer FK to them.

How can I populate a sub-property of a class with data coming from different tables?

Thanks a million!
Alessandro Federici


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

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.