简体   繁体   English

如何将默认忽略的@beanmapping 从JDL 设置为false

[英]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.我正在尝试从 JDL 文件生成我的实体和 dto,我需要映射器文件放置@BeanMapping(ignoreByDefault=false)以恢复关系 dto 的所有属性,而不仅仅是 id。 But when I generate dtos from JDL file ignoredByDefault is set to true.但是当我从 JDL 文件生成 dtos 时,ignoredByDefault 设置为 true。 Is there any way to change this behaviour?有什么办法可以改变这种行为吗?

What I got in my jdl file (after my entities and relationships parts) is:我在我的 jdl 文件中得到的(在我的实体和关系部分之后)是:

dto * with mapstruct dto * 与 mapstruct

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.不,没有办法,因为您可以通过查看生成器代码中的EntityMapper 模板轻松找到:这一行根本不是条件性的。

So, the easy way is to modify generated code manually, the hard way would be to write a blueprint but it seems overkill.因此,简单的方法是手动修改生成的代码,困难的方法是编写蓝图,但这似乎有点过分了。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM