Proper mapping of one-to-one relationship
481046Feb 7 2006 — edited Feb 7 2006I have a table A with around fifteen fields including a lookup_code field that has a one to one mapping with a lookup table B that contains just two fields, the lookup code and a lookup code description. There are around 20 rows in the lookup table that are referenced by the many rows in table A.
I'm trying to decide on the right strategy for mapping this and would like to avoid having two different classes, class A and B mapping to these tables. It seems like my choices are:
1. onetoone using valueholderinterface
2. onetoone using joining
3. aggregate descriptor (but don't think this will work because each row in B doesn't have a unique relationship to a row in A)
I'd like to avoid multiple classes, but it does seem like option 2 is my best bet. Can anyone tell me what's recommended here?
Thanks,
Mark