Annotation Type DtoMixin
Overlay
DtoPath/DtoRef/DtoConvert annotations onto a DTO type that
cannot be annotated directly - typically because it's generated elsewhere (e.g. from an
OpenAPI spec) and regenerated on every build.
Declared on a companion interface (or class) whose methods mirror the target DTO's property
names; the querybean-generator processor matches each mixin method to the corresponding
property on value() by name, and applies whichever of @DtoPath/@DtoRef/
@DtoConvert is present on the mixin method as if it were declared on the target
property itself. Mirrors avaje-jsonb's @Json.MixIn mechanism, which solves the exact
same "can't annotate a generated/unowned type" problem.
@DtoMixin(Driver.class)
interface DriverDtoMixin {
@DtoPath("encryptedDriverId")
@DtoConvert(value = DriverConversions.class, method = "decrypt")
String driverId();
}
This is purely a compile-time / codegen-time hint - the mixin type itself is never instantiated and carries no runtime footprint.
-
Required Element Summary
Required Elements
-
Element Details
-
value
Class<?> valueThe real DTO type this mixin overlays annotations onto.
-