Improved metadata about a basic-typed value

Description

So we know that `someStringValue` is a basic type and that its Java type is String. But we are still left to guess how to handle this in terms of the underlying database column. Atm we make an assumption based on the fact that the field type is a String, we use that to resolve that to Hibernate's StringType which maps a String to a VARCHAR.

There are already recognized "hints" intended to help alter the relational understanding. E.g. @Lob, @Nationalized, etc. What is being proposed here are some additions to these. Specifically I can see:

  1. @JdbcTypeCode - i.e. @JdbcTypeCode(Types#LONGNVARCHAR) @Basic String someStringValue;

  2. @MutabilityPlan

  3. @Comparator

  4. some annotation to specify an "equals and hashCode" stratgey

  5. some annotation to specify a wrap/unwrap strategy

The last 4 really just describe the components of a JavaTypeDescriptor, so we'd only need those if a JavaTypeDescriptor is not known or if the user wants deviations from the normal semantics.

These values would also get picked up by AttributeConverter support for it to be able to better understand the various "types" (the 2 JavaTypeDescriptors and the SqlTypeDescriptor) involved in its conversion

Environment

None

Assignee

Unassigned

Reporter

Steve Ebersole

Fix versions

Labels

None

backPortable

None

Suitable for new contributors

None

Requires Release Note

None

Pull Request

None

backportDecision

None

Priority

Major
Configure