jTransfo, 0.10

org.jtransfo
Annotation Type MappedBy


@Retention(value=RUNTIME)
@Target(value=FIELD)
@Documented
public @interface MappedBy

Annotation which indicates how the field in the transfer object should be mapped to a field in the domain object.

By default fields are mapped in both directions between fields of the same name.


Optional Element Summary
 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
          Fully qualified class name for the type converter.
 Class typeConverterClass
          Class to use for type conversion.
 

field

public abstract String field
Name of the field in the domain class.

By default the field is assumed to have the same name in the domain class.

Default:
"?"

path

public abstract String path
Path to the field when it is transitive.

By default the path is empty, meaning that the field is inside the domain object itself.

Default:
""

typeConverter

public abstract String typeConverter
Fully qualified class name for the type converter.

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.

Default:
"?"

typeConverterClass

public abstract Class typeConverterClass
Class to use for type conversion.

This requires a compile dependency on the domain class. The value has precedence over typeConverter().

Default:
org.jtransfo.MappedBy.DefaultTypeConverter.class

readOnly

public abstract boolean readOnly
When set, the field will never be written in the domain class.

Default:
false

jTransfo, 0.10

Copyright © 2013. All rights reserved.