@Retention(value=RUNTIME) @Target(value={FIELD,ANNOTATION_TYPE}) @Repeatable(value=MapOnlies.class) @Documented public @interface MapOnly
MapOnlies
annotation then the field will only be copied when one of the tags in the MapOnly or MapOnlies annotation is present.
In that case the MappedBy
annotation on the field will only be used to provide defaults for field/path or
type converter.
By default fields are mapped in both directions between fields of the same name.
Modifier and Type | Fields and Description |
---|---|
static String |
ALWAYS
Tag which can be used to assure it is always called (handled before the specific cases).
|
Modifier and Type | Required Element and Description |
---|---|
String[] |
value
Tags for which this annotation applies.
|
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 not be written in the domain class when the tag is present.
|
String |
typeConverter
Fully qualified class name for the type converter.
|
Class |
typeConverterClass
Class to use for type conversion.
|
public static final String ALWAYS
public abstract String[] value
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 boolean readOnly
public abstract Class typeConverterClass
Using this allows you to override the type converter on the MappedBy
annotation.
This requires a compile dependency on the domain class. The value has precedence over typeConverter()
.
Copyright © 2022. All rights reserved.