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

Allow to add JoinTable and InverseJoinColunm ORM attributes #1318

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

trislem
Copy link

@trislem trislem commented Jun 5, 2023

Proposition : Allow to add JoinTable attribute on ManyToMany relations and InverseJoinColumn attribute on ManyToMany, ManyToOne and OneToOne relations

Points of attention :

Point 1 : Other attributes can be added. It may be preferable to only allow a whitelist with JoinTable and InverseJoinColumn instead.

Point 2 : It's not be possible to override attributes added added by the manipulator, for example, the JoinColumn on ManyToOne and OneToOne for non-nullable owning relation. Maybe it should be more permissive.

Point 3 : the attributes array becomes indexed by string (the mapping class) to not allow the same attribute multiple time, it's set back to numerical indexes before the addProperty as before. Maybe it should be more permissive if some mapping attributes may appear multiple time on the same class attribute ?

Point 4 : test only cover my initial need : adding JoinTable and InverseJoinColumn on ManyToMany relation, not InverseJoinColumn on ManyToOne and OneToOne. But tests cover that JoinTable can't be used on others relations than ManyToMany and that InverseJoinColumn can't be used on OneToMany. Tests also cover that a relation mapping can't be added as additionnal attribute on itself (for example, adding ManyToMany additionnal attribute on a RelationManyToMany)

Related issue : #1316

@trislem trislem force-pushed the allow-custom-additionnal-attribute-node branch 2 times, most recently from 8f6e6a8 to 1c4e2b3 Compare June 8, 2023 11:47
Allow to add JoinTable attribute on ManyToMany relations and InverseJoinColumn attribute on ManyToMany, ManyToOne and OneToOne relations
@trislem trislem force-pushed the allow-custom-additionnal-attribute-node branch from 1c4e2b3 to a567a2c Compare June 22, 2023 13:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant