Allow types to have access to target usage data

Description

In order to being able to support a type hierarchy without having to write a Type per class, access to the actual target property type is needed. This has been hardcoded in org.hibernate.cfg.annotations.SimpleValueBinder for some Hibernate types, such as org.hibernate.type.EnumType and org.hibernate.type.SerializableToBlobType.

Even for the same scenarios above, if one is trying to write his own type for enums or serializables, he has to end up writing a type per target class since the same facility is not provided by Hibernate in a general fashion.

Hence, Hibernate should provide a set of standard properties for type implementations that need actual target usage data. Since some types might use the same property names used by EnumType with a different meaning, injecting these properties for any ParameterizedType might break existing types. Therefore, a ParameterizedType subinterface which also declares the standard property names for this case seems a better design choice.

Environment

hibernate-core:4.1.0.Final

Assignee

Strong Liu

Reporter

Michael Nascimento

Fix versions

Labels

backPortable

None

Suitable for new contributors

None

Requires Release Note

Affirmative

Pull Request

None

backportDecision

None

Components

Affects versions

Priority

Major
Configure