document the use of typing annotations as meta-annotations
This commit is contained in:
parent
60e5b75282
commit
e89015fd8c
|
@ -144,6 +144,20 @@
|
|||
* These two approaches cannot be used together. A {@code UserType} always takes precedence
|
||||
* over the compositional approach.
|
||||
* <p>
|
||||
* All the typing annotations just mentioned may be used as meta-annotations. That is,
|
||||
* it's possible to define a new typing annotation like this:
|
||||
* <pre>
|
||||
* @JavaType(ThingJavaType.class)
|
||||
* @JdbcTypeCode(JSON)
|
||||
* @Target({METHOD, FIELD})
|
||||
* @Retention(RUNTIME)
|
||||
* public @interface JsonThing {}
|
||||
* </pre>
|
||||
* The annotation may then be applied to fields and properties of entities and embeddable
|
||||
* objects:
|
||||
* <pre>
|
||||
* @JsonThing Thing myThing;
|
||||
* </pre>
|
||||
* The packages {@link org.hibernate.type.descriptor.java} and
|
||||
* {@link org.hibernate.type.descriptor.jdbc} contain the built-in implementations of
|
||||
* {@code JavaType} and {@code JdbcType}, respectively.
|
||||
|
|
Loading…
Reference in New Issue