Skip to content

Package: Convert

Convert

Coverage

1: package cz.cvut.kbss.jopa.model.annotations;
2:
3: import java.lang.annotation.ElementType;
4: import java.lang.annotation.Retention;
5: import java.lang.annotation.RetentionPolicy;
6: import java.lang.annotation.Target;
7:
8: /**
9: * Specifies the conversion of a Basic field or property.
10: * <p>
11: * The {@code Convert} annotation should not be used to specify conversion of the following: Id attributes, version
12: * attributes, relationship attributes, and attributes explicitly denoted as Enumerated or Temporal. Applications that
13: * specify such conversions will not be portable.
14: * <p>
15: * The {@code Convert} annotation may be applied to a basic attribute or to an element collection of basic type (in
16: * which case the converter is applied to the elements of the collection).
17: */
18: @Target(ElementType.FIELD)
19: @Retention(RetentionPolicy.RUNTIME)
20: public @interface Convert {
21:
22: /**
23: * Specifies the converter to be applied.
24: * <p>
25: * A value for this element must be specified if multiple converters would otherwise apply.
26: */
27: Class<?> converter() default void.class;
28:
29: /**
30: * Used to disable an auto-apply converter. If disableConversion is true, the converter element should not be
31: * specified.
32: */
33: boolean disableConversion() default false;
34: }