I'm trying get NHibernate to work with tables that are not normalized properly (and I can't do anything about it)
Here is a sample table:
CONTACT1
NAME, ... ADDRESS1, ADDRESS2, ADDRESS3, CITY, STATE, ZIP, ... PHONE1, PHONE2, PHONE3
I'm having trouble dealing with the multiple ADDRESS fields and the multiple PHONE fields, for different reasons.
The Address fields I want to role up into a class that contains:
Address
---------
Street
City
State
Zip
So I basically want to concatenate the 3 Address fields with a line break between them and put it in the "Street". Another comparable solution would be to use collection of "Streets" for each Address.
The second problem are the phone numbers.
I want them each in there own class of:
PhoneNumber
Number
I know I could solve these using a view on the backend, but I'm trying to get this done within NHibernate. If it makes a difference, this application only reads the data, it does not write it back.
I'm very new to Hibernate and I'm trying to wrap my head around all of this. I've read the documentation on hibernate.org... if anyone can point me in the right direction I'd be very appreciative.
Thanks,
Patrick
|