I have two tables with a common field that have a 1:n relation in one direction, and an m:1 relation in the other direction. I want a typed list that obeys weak relations, and therefore want to use the 1:n relation. However, when I add the tables to the TL, the order is changed so that it always chooses the m:1 relation; no matter how I add the tables, I cannot get the n:1 relation.
The strange thing is, I have another table that is nearly identical except for one field, with the same relations, and for this table I can get the 1:n relation. For example:
UserKey
-----------
UserKeyID (PK)
CustomerID (FK to Customer)
KeyID (FK to Key)
Value
SystemKey
--------------
SystemKeyID (PK)
LocationID (FK to Location which is a child of Customer)
KeyID (FK to Key)
Value
Key
-----
KeyID (PK)
Description
DefaultValue
When I build a TL with UserKey and Key, I can get the 1:n relation for Key:UserKey. But when I build a TL with SystemKey and Key, I can only get the m:1 relation for SystemKey:Key.
I don't really understand why the LLBLGen GUI behaves differently in these two cases. Nevertheless, at this point it seems my only option is to modify the generated code, or derive a class from it and override the GetRelationInfo() method.
Any other advice would be appreciated.