persistence icon indicating copy to clipboard operation
persistence copied to clipboard

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

Open gavinking opened this issue 1 year ago • 1 comments

@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 avatar Nov 11 '24 10:11 gavinking

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

gavinking avatar Nov 11 '24 16:11 gavinking