📌  相关文章
📜  ModelMapper 跳过字段 codegrepper - 任何代码示例

📅  最后修改于: 2022-03-11 14:58:12.907000             🧑  作者: Mango

代码示例1
ModelMapper modelMapper = new ModelMapper();
        modelMapper.addMappings(new PropertyMap() {
            @Override
            protected void configure() {
                skip(destination.getFatherDetailsEntity().getUser());
            }
        });
        user=modelMapper.map(request, UserEntity.class);

        System.out.println("Request=>" +user);
OUTPUT: UserEntity{userId=0, firstName='null', lastName='Ahsan', userName='ArslanAhsan2', creationTime=null, fatherDetailsEntity=FatherDetailsEntity{id=null, fatherName='ABCD', cnic='38201'}}