Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multiple unidirectional inverse relations #208

Open
tavoda opened this issue Sep 3, 2019 · 0 comments
Open

Multiple unidirectional inverse relations #208

tavoda opened this issue Sep 3, 2019 · 0 comments
Assignees
Labels
Milestone

Comments

@tavoda
Copy link
Member

tavoda commented 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:

Entity Person {
    - Set<@House> managed inverse
    - Set<@House> owned inverse
    ...
}

Is equivalent of:

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?

@tavoda tavoda changed the title Multiple unidirectional inverse relation Multiple unidirectional inverse relations Sep 3, 2019
@tavoda tavoda self-assigned this Sep 6, 2019
@tavoda tavoda added the bug label Sep 6, 2019
@tavoda tavoda added this to the 3.2.0 milestone Sep 6, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant