Search code examples
javajhipstermapstructjdl

How to put @beanmapping ignored by default to false from JDL


I'm trying to generate my entities and dtos from a JDL file, and I need that mapper files put @BeanMapping(ignoreByDefault=false) for recovering all the properties of a relationship's dto and not only the id. But when I generate dtos from JDL file ignoredByDefault is set to true. Is there any way to change this behaviour?

What I got in my jdl file (after my entities and relationships parts) is:

dto * with mapstruct


Solution

  • No, there's no way as you can easily find out by looking at the EntityMapper template in generator's code: this line is not conditional at all.

    So, the easy way is to modify generated code manually, the hard way would be to write a blueprint but it seems overkill.