|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: REQUIRED | OPTIONAL | DETAIL: ELEMENT | |||||||||
@Target(value=FIELD) @Retention(value=RUNTIME) public @interface Convert
The value of this Convert annotation point to a class, the implementation of this class will used to convert field value to database column value, and column value to database, for example:
@Convert(XxxDateConverter.class) private Date date;// Tell ORM Tool use XxxDateConverter to do the convert @Convert(XxxEnumTranslator.class) private Enum some1;// Tell ORM Tool use XxxEnumTranslator to do the convert @Convert() private Enum some2; // Tell ORM Tool decide how to do the convert by ORM tool itself
| Optional Element Summary | |
|---|---|
String |
attributeName
The attributeName element must be specified unless the
Convert annotation is on an attribute of basic type or on an
element collection of basic type. |
Class<?> |
converter
Specifies the converter to be applied. |
boolean |
disableConversion
Used to disable an auto-apply or inherited converter. |
Class<?> |
value
|
public abstract Class<?> value
public abstract Class<?> converter
public abstract String attributeName
attributeName element must be specified unless the
Convert annotation is on an attribute of basic type or on an
element collection of basic type. In these cases, the
attributeName element must not be specified.
public abstract boolean disableConversion
converter element should not be specified.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: REQUIRED | OPTIONAL | DETAIL: ELEMENT | |||||||||