persistence
persistence copied to clipboard
@MapKey(name=...) inconsistent with @OrderBy(....)
@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.
In a way it should really be @MapKey(mappedBy= .... ). That would make the true semantics much clearer.