@Retention(value=RUNTIME) @Target(value={FIELD,ANNOTATION_TYPE}) @Documented public @interface MappedBy
By default fields are mapped in both directions between fields of the same name.
Modifier and Type | Fields and Description |
---|---|
static String |
DEFAULT_FIELD
Default value for
field() indicating that then domain object field is expected to have the same name as
the annotated field. |
static String |
DEFAULT_PATH
Default value for
path() indicating that then domain object field is in the domain object itself. |
static String |
DEFAULT_TYPE_CONVERTER
Default value for type converter class name, indicating no name specified.
|
Modifier and Type | Optional Element and Description |
---|---|
String |
field
Name of the field in the domain class.
|
String |
path
Path to the field when it is transitive.
|
boolean |
readOnly
When set, the field will never be written in the domain class.
|
String |
typeConverter
Name for the type converter, this is either name (when it implements
Named or the
Fully qualified class name. |
Class |
typeConverterClass
Class to use for type conversion.
|
public static final String DEFAULT_TYPE_CONVERTER
public abstract String field
By default the field is assumed to have the same name in the domain class.
public abstract String path
By default the path is empty, meaning that the field is inside the domain object itself.
public abstract String typeConverter
Named
or the
Fully qualified class name.
Using this allows you to avoid a compile dependency on the class name but makes the connection more brittle
when refactoring. The value is ignored if typeConverterClass()
is set.
public abstract Class typeConverterClass
This requires a compile dependency on the domain class. The value has precedence over typeConverter()
.
Copyright © 2022. All rights reserved.