You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When you declare multiple inverse relations without opposite attribute (unidirectional) they are working like single relation because only name of table is used in opposite table. Example, if you declare two fields in same entity like:
Entity Person {
- Set<@House> managed <-> person inverse
- Set<@House> owned <-> person inverse
...
}
This mean that in table HOUSE is created only single attribute PERSON which will point to person entity. This mean if you add house e.g. to 'managed' field, it will be fetched also for 'owned' field.
Solution:
We can add field name to inverse relation, instead of PERSON we can use 'PERSON_MANAGED' and 'PERSON_OWNED' field names in HOUSE table but this have one disadvantage, it's not backward compatible. Big problem for migration to new version.
We can introduce check and use attribute names only when more than one relation exist, which is anyway of low probability. Somebody better idea?
The text was updated successfully, but these errors were encountered:
tavoda
changed the title
Multiple unidirectional inverse relation
Multiple unidirectional inverse relations
Sep 3, 2019
When you declare multiple inverse relations without opposite attribute (unidirectional) they are working like single relation because only name of table is used in opposite table. Example, if you declare two fields in same entity like:
Is equivalent of:
This mean that in table HOUSE is created only single attribute PERSON which will point to person entity. This mean if you add house e.g. to 'managed' field, it will be fetched also for 'owned' field.
Solution:
We can add field name to inverse relation, instead of PERSON we can use 'PERSON_MANAGED' and 'PERSON_OWNED' field names in HOUSE table but this have one disadvantage, it's not backward compatible. Big problem for migration to new version.
We can introduce check and use attribute names only when more than one relation exist, which is anyway of low probability. Somebody better idea?
The text was updated successfully, but these errors were encountered: