Hi all,
I don't think this is possible in NH, but I'm hopeful someone will be
able to tell me I'm wrong! I have a database structure like this:
Table Person { ID (pk), Name, AddressTypeID }
Table AddressTypes { ID (pk), AddressTypeID, AddressID, Type
(varchar) }
Table Address { AddressID (pk), Street, City }
So, basically a person links to MANY address types (where
person.AddressTypeID = addressTypes.AddressTypeID) , and each address
type links to ONE address (where address.AddressID =
addressTypes.AddressID). The 'ID' pk column on AddressTypes doesn't
appear to be used anywhere else on the system.
I know that this isn't the best database structure in the world, but I
can't change it.
Ideally, I'd like to be able to map this to a domain model like this:
class Person
{
Guid Id;
string Name;
IList<Address> Addresses;
}
class Address //so this class must JOIN AddressTypes & Address
{
string Type;
string Street;
string City;
}
But I can change the model if something else would work.
Can anyone confirm if this is possible or not?
Thanks,
Simon.
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---