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: mapping problem
PostPosted: Thu Jan 25, 2007 10:16 am 
Newbie

Joined: Mon Aug 21, 2006 9:47 am
Posts: 12
NHibernate version: 1.2.0 Beta 3

Mapping documents:

Hello Everybody,
I have an interesting mapping challange, that i think nhibernate should be able to handle, but i have failed to create mapping that does.

I have a database model, which looks like this:

Image

I have a domain model, which id like to look like this:

Image

The ContactInfo class contains businesses' or people's contact information (E-mail, ICQ, Phone numbers etc.) Therefore, the Business and Person objects should have a list of ContactInfo-s.

The mapping should be based on the "ContainerId" column in `Business` and "ContainerId" in `ContactInfo`.

Is it possible to do this without creating a ContactInfoContainer class in the domain model? I am not particularly interested in changing the database structure (i.e. removing the `ContactInfoContainer` table and using a discriminator column in the `ContactInfo` table instead.)


Top
 Profile  
 
 Post subject:
PostPosted: Thu Feb 01, 2007 2:25 am 
Senior
Senior

Joined: Mon Aug 21, 2006 9:18 am
Posts: 179
AFAIK doing fk joins isn't supported.
This seems like one of those places where the impedance mismatch between relational and oo thinking is revealed...Personally, I'd opt for the simplest solution and not worry so much about normalization (which is what it sound like you are trying to preserver by avoiding the discriminator?)

Good luck,
MIKE

_________________
If this helped...please remember to rate it!


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.