From dbd4151e9ad85e41e4529aa6df4a5dd488336c43 Mon Sep 17 00:00:00 2001 From: Reinier Zwitserloot Date: Thu, 17 Mar 2022 23:26:35 +0100 Subject: [fixes #2991] Add documentation note on mixing mapstruct and fieldnameconstants in `@Mapping`. --- website/templates/features/experimental/FieldNameConstants.html | 2 ++ 1 file changed, 2 insertions(+) (limited to 'website/templates/features') diff --git a/website/templates/features/experimental/FieldNameConstants.html b/website/templates/features/experimental/FieldNameConstants.html index 06fa23b5..cc147d51 100644 --- a/website/templates/features/experimental/FieldNameConstants.html +++ b/website/templates/features/experimental/FieldNameConstants.html @@ -58,6 +58,8 @@ Any parameters of lombok annotations that take strings need to be supplied actual string literals; you cannot have references to constants like those generated by @FieldNameConstants. If you'd like to use @FieldNameConstants to for example fill in the of and/or exclude parameters of @ToString and similar lombok annotations, use the @ToString.Include / @ToString.Exclude etc system instead; these are described at the feature pages for those features.

Like other lombok handlers that touch fields, any field whose name starts with a dollar ($) symbol is skipped entirely. Such a field will not be modified at all. Static fields are also skipped. +

+ MapStruct interop: When making references to field name constants inside MapStruct's @Mapping, and you use that annotation more than once on a node, you must manually wrap these in the @Mappings 'container annotation'. Like so: @Mappings({@Mapping(target = Entity.Fields.entityProperty, source = "dtoProperty")}).

-- cgit