Problem: In Java when you are using Mapstruct and it returns next error:
Mapping of Enums via @Mapping is removed. Please use @ValueMapping instead!
Solution: The problem is that you are using @Mapping and you have to use @ValueMapping when you are mapping Enums.
Example:
//Correctly mapping between enums
@ValueMapping(source="value1_typeTwo", target="value1_typeOne")
@ValueMapping(source="value2_typeTwo", target="value2_typeOne")
@ValueMapping(source="value3_typeTwo", target="value3_typeOne")
TypeOneEnum typeTwoEnumToTypeOneEnum(TypeTwoEnum typeTwoEnum)
For more interesting tutorials & guides just check them HERE.
Thankfulness to my father who informed me concerning this web site, this webpage
is truly awesome.
Hey! Someone in my Myspace group shared this site with us
so I came to give it a look. I’m definitely loving the
information. I’m book-marking and will be tweeting this to my followers!
Great blog and fantastic design.
Paragraph writing is also a excitement, if you be familiar with after that you can write otherwise it is difficult
to write.
Thanks for finally writing about > Mapstruct: Mapping of Enums via @Mapping is removed.
Please use @ValueMapping instead! - Fix the
bugs < Loved it!
You really make it seem so easy with your presentation but I find this matter to be actually something
which I think I would never understand. It seems too complex and very broad for me.
I’m looking forward for your next post, I’ll try to
get the hang of it!