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

Correcting bidirectional relationships using JPA's "mappedBy" #242

Open
pplupo opened this issue Oct 30, 2024 · 0 comments
Open

Correcting bidirectional relationships using JPA's "mappedBy" #242

pplupo opened this issue Oct 30, 2024 · 0 comments

Comments

@pplupo
Copy link

pplupo commented Oct 30, 2024

I know it's tricky to identify bidirectional relationships, and the default behavior is to map two unidirectional relationships.

However, if you can read the JPA annotations, you can also identify the "mappedBy" attributes and create a bidirectional relationship.

It shouldn't be a configuration dependent on displaying the JPA annotations, though. Someone can use the JPA mappedBy to have a more "correct" model but not necessarily decide to display the annotations on the diagram.

So, I suggest a separate configuration for using JPA annotations with "mappedBy" to create bidirectional relationships in the diagram.

There should also be an option to display the arrow on the relationship when it's directional because, in this case, we can tell what is directional and what isn't with certainty.

This will not only make the charts easier to read. It's going to make them correct. We are dealing with incorrect charts because of technological restraints (when we don't have the metadata to connect two ends of a relationship), but it doesn't always have to be the case. We can get accurate charts in these circumstances, and I think we should do it.

@pplupo pplupo changed the title Bidirectional relationships using "mappedBy" Correcting bidirectional relationships using JPA's "mappedBy" Oct 30, 2024
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

No branches or pull requests

1 participant