Annotation Interface MapsTo
This annotation is consulted only while mapping selector paths from the DTO query contract to the underlying entity model. For each field in the resolved DTO path, the mapper contributes either the DTO field name itself or the value declared here.
If @MapsTo is absent, the DTO field name is reused as the
corresponding entity-side segment. If @MapsTo is present, its
value() is appended instead. When absolute() is
true, any previously accumulated parent segments are discarded before
the mapped value is appended.
Example:
class UserDto {
@MapsTo("profile")
private ProfileDto details;
class ProfileDto {
@MapsTo("displayName")
private String name;
}
}
With that contract, the DTO selector details.name maps to the
entity path profile.displayName.
-
Required Element Summary
Required Elements -
Optional Element Summary
Optional ElementsModifier and TypeOptional ElementDescriptionbooleanWhether this mapping starts a new absolute path from the entity root.
-
Element Details
-
value
String valueEntity-side field segment or dotted subpath to append for this DTO field.The declared value is inserted into the mapped entity path in place of the DTO field name.
- Returns:
- mapped entity field segment or subpath
-
-
-
absolute
boolean absoluteWhether this mapping starts a new absolute path from the entity root.When
true, previously accumulated parent segments are discarded beforevalue()is applied.- Returns:
trueto reset parent segments, otherwisefalse
- Default:
- false
-