mapstruct

    0熱度

    1回答

    我想申請一個裝飾使用專用@AfterMapping後單個項目轉換的DTO和另一個專用的@AfterMapping處理其集合轉換的味道,但不是兩個。 public abstract CatUI convert(Cat cat); public abstract List<CatUI> convert(List<Cat> cats); @AfterMapping public void po

    0熱度

    2回答

    也許這可能是一個非常簡單的問題,但在解決給定問題時我很迷茫。 我打過電話MediaResource一個實體,它有ID,imageName等領域,在另一方面,有MediaResourceDTO它有imageName,字節[]等的resourcefile 的想法是獲取圖像名稱從數據庫,併發送MediaResourceDTO到客戶端之前,我想加載圖像文件到MediaResourceDTO。 我不知道如何

    0熱度

    1回答

    我有以下映射: @Mapper public interface ParticulierMapper { ParticulierMapper INSTANCE = Mappers.getMapper(ParticulierMapper.class); TParticulier toDTO(Particulier particulier); Particulier toEntity(TPa

    0熱度

    1回答

    我想如果所有屬性在@映射/源引用都爲空所生成的mapstruct映射方法返回null。 對於爲例,我有以下映射: @Mappings({ @Mapping(target = "id", source = "tagRecord.tagId"), @Mapping(target = "label", source = "tagRecord.tagLabel") }) Tag

    1熱度

    2回答

    我使用的是MapStruct產生的一個映射: @Mapper public interface CustomerMapper { Customer mapBankCustomerToCustomer(BankCustomerData bankCustomer); } 默認組件模型是春天。(在pom.xml中集) <compilerArg>-Amapstruct.defaultCo

    1熱度

    1回答

    以下是我的上下文:我使用byteBuddy動態生成一個類,該對象基於外部配置將對象轉換爲另一個對象。我遇到了一些問題,我想找到一個替代方案,就是我發現MapStruct的方式。 所以我試圖構建簡單的映射器,我想知道是否有可能定製註釋以添加轉換函數。比如我想有: @Mapping( source = "mySourceField", sourceType = "String",

    1熱度

    1回答

    這裏是我的源對象: public class Record { public final long captureTime; public final String environnement; public final String bundle; public final String type; public final String id

    0熱度

    1回答

    我有一種情況,即在DTO內部有另一個DTO,必須將其映射到其對應的實體。 我使用的是地圖結構,我已經有AnotherEntityMapper已經存在。 DTO public class EntityDTO { private AnotherEntityDTO anotherEntityDTO; // other fields } Entity @Entity

    0熱度

    1回答

    我有一個名爲TripEvent(持久性實體)的實體對象..請參閱下面我想引起注意的字段被創建和列表 列表 @Entity @Table(name = "TRIPEVENT") @JsonIdentityInfo(generator = ObjectIdGenerators.IntSequenceGenerator.class, property = "@tripeventId") publi

    0熱度

    1回答

    我想有一個這樣的映射器,映射器的一種方法應該忽略角色字段。 @Mapper public interface UserMapper { UserDTO userToUserDTO(User user); @Mapping(target = "roles", ignore = true) UserDTO userToUserDTOWithoutRoles(U