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
|