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

@MapKey(name=...) inconsistent with @OrderBy(....) #684

Open
gavinking opened this issue Nov 11, 2024 · 1 comment · May be fixed by #685
Open

@MapKey(name=...) inconsistent with @OrderBy(....) #684

gavinking opened this issue Nov 11, 2024 · 1 comment · May be fixed by #685
Labels
candidate-for-4 Good candidate for JPA 4

Comments

@gavinking
Copy link
Contributor

@MapKey and @OrderBy are extremely conceptually-similar in that they each reference a field of the associated entity. They are both different to @OrderColumn and @MapKeyColumn in that these latter annotations provide column names.

But @MapKey has a name member like @XxxColumn annotations instead of a value member like @OrderBy.

This is inconsistent and unnecessarily verbose.

I think we should add value and deprecate name.

@gavinking gavinking added the candidate-for-4 Good candidate for JPA 4 label Nov 11, 2024
gavinking added a commit to gavinking/jpa-api that referenced this issue Nov 11, 2024
@gavinking gavinking linked a pull request Nov 11, 2024 that will close this issue
@gavinking
Copy link
Contributor Author

gavinking commented Nov 11, 2024

In a way it should really be @MapKey(mappedBy= .... ). That would make the true semantics much clearer.

gavinking added a commit to gavinking/jpa-api that referenced this issue Nov 23, 2024
also write proper javadoc, and clean up the spec

see jakartaee#687

see jakartaee#684

Signed-off-by: Gavin King <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
candidate-for-4 Good candidate for JPA 4
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant