Annotation Interface MapKeyFormula
Specifies an expression written in native SQL that is used to read the key
of a
Map instead of storing it in a
MapKeyColumn.
The expression is evaluated against the table holding the map entries, that is, the collection table, or the table of the target entity for a one-to-many association without a join table:
@OneToMany(mappedBy = "parent")
@MapKeyFormula("upper(code)")
Map<String, Child> children;
Since the key is derived, it is never written to the database.
- Since:
- 8.0
- See Also:
-
Required Element Summary
Required Elements
-
Element Details
-
value
String valueThe formula, written in native SQL.
-