Skip to content

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

@pplupo

Description

@pplupo

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions