我正在使用Mapstruct (与lombok一起使用),而Mapstruct在调用端点(使用MapStruct将DTO映射到实体)后对应用程序进行对接时失败。(LaunchedURLClassLoader.java:151) at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:522)的java.lang.ClassNotFoundException: org.mapstruct.factory.Mapp
我们在MapStruct中使用不可变表,在将实体转换为数据时遇到了问题。@Immutable Long getCount();
} mapper类; After I uncomment the inner class of project statistics then even this does not work (Error 2) 在出错的情况下我检查了不可变映射结构的
// + other fields, getters and setters现在,我希望在API中为DTO提供ParseError属性,但不提供整个Recipe实体,因为它包含在本例中不需要的ManyToOneParseError, Integer> {}
但是,看起来Micronaut数据无法从嵌套实体中投影属性,或者我忽略了DTO或存储库方法中的一些内容RecipeDto类型的属性配方与实体中声明的等效属
我们通常使用DTO将对象从一种形式转换为另一种形式(比如JSON),所以我的疑问是:我是否可以将DTO id用作字符串,或者应该只保留它的长度?我的Model anyhow使用long for id,我使用mapstruct将对象从模型映射到DTO,如果我使用id作为字符串,而不是long for DTO类,我是否会在POST/GET中遇到任何问题