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: 1:1 modeling issue - inducing left joins
PostPosted: Fri Oct 30, 2009 6:49 am 
Beginner
Beginner

Joined: Thu Sep 17, 2009 8:53 am
Posts: 20
Hi there!

I've recently encountered following problem:

I'm currently modeling 1:1 relationships between table a and table b, where b has a property pointing to a's Id as a foreign key, like this:

In A:
<one-to-one name="B" class="B" property-ref="A"/>

In B:
<many-to-one name="A" column="a" not-null="WhatEverIsFitHere" foreign-key="FK_B_A"/>

This does work, the trouble is, that even if I do not require the data in table B (in a query on A via the Criteria API) NHibernate does a left outer join on those tables and selects all of their mapped columns.

Needless to say, that performance is seriously impeded by this.

Am I doing something wrong here? Should I model these relations another way?

Thanks a lot,
greetings
Benjamin


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.