Annotation Interface MapsTo
Declares the entity-side property segment that a DTO field maps to for
filtering and sorting path translation.
When DTO-aware query resolution is enabled, each path segment is resolved on the DTO class and then translated to an entity path using this annotation. If absent, the DTO field name itself is used as the entity segment.
Example:
class UserDto {
@MapsTo(field = "profile")
private ProfileDto details;
class ProfileDto {
@MapsTo(field = "displayName")
private String name;
}
}
-
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
-
field
String fieldEntity-side field or path segment to use for this DTO field.- Returns:
- mapped entity path segment
-
absolute
boolean absoluteWhether this mapping starts a new absolute path from the entity root.When
true, previously accumulated parent segments are discarded before this segment is applied.- Returns:
trueto reset parent segments, otherwisefalse
- Default:
false
-