Hi, if anyone could spare some time for a stressed developer i'd
appreciate some pointers. i'm working with the following domain model:
class AddressPicker
_addressDetails : Address
class Address:
_otherAddress : OtherAddress
class OtherAddress:
_mainAddress : Address
_other : Address
The database model to support this is as follows:
Table AddressPicker:
Id : int
AddressId : int
Table Address:
Id : int
Table OtherAddress:
Id : int
MainAddressId : int
OtherAddressId : int
The relevant lines from the NH mapping files are as follows:
AddressPicker:
<many-to-one name="AddressDetails" column="AddressId"
class="Address" fetch="join"
Address:
<one-to-one name="OtherAddress" property-ref="MainAddress"
class="OtherAddress" fetch="join"
OtherAddress:
<many-to-one name="MainAddress" column="MainAddressId"
class="Address" fetch="join"
<many-to-one name="Other" column="OtherAddressId"
class="Address" fetch="join"
THE PROBLEM:
When trying to list AddressPicker objects the calls to the database
include the SELECT AddressPicker as desired, but also a SELECT
OtherAddress where MainAddressId = x. There being an x for each of the
Address Ids in the returned AddressPickers.
I have tried using SetFetchMode
("AddressDetails.OtherAddress.MainAddress", FetchMode.Join), which
didn't seem to make much difference.
Also have set lazy loading to false on all the mapping files.
If anyone could give me some pointers on this one it would be hugely
appreciated!
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"nhusers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/nhusers?hl=en
-~----------~----~----~----~------~----~------~--~---