I write an entity value-object and a data-transfer-object , they have "isDelete" property both.

Then I wrote an adapter to try to connect the front and rear modules. most of them were copied successfully, when I called org.springframework.beans.BeanUtils.copyProperties. but, the prop called "isDelete" can't be copy. when "isDelete" is null and inserted, my application cannot judge the pseudo deletion.

(isDelete() method is generated by kotlin or lombok when "isDelete" property has been written)

so I tried cn.hutool.core.bean.BeanUtil to solved this problem. cn.hutool hutool-all 5.8.10

I hope we can be compatible with the naming at the beginning of "is" method,it can brings reduces the volume of the application.

Thanks

Comment From: Deycoesr

Can you provide a reproducible example code ?

I try to use code like this locally:

public static void main(String[] args) {

    Test source = new Test();
    source.setDelete(false);

    Test target = new Test();
    target.setDelete(true);

    org.springframework.beans.BeanUtils.copyProperties(source, target);

    System.out.println("target.isDelete() = " + target.isDelete());

}

@Data
public static class Test {

    private boolean delete;

}

But you describe doesn't happen.

This is the final result: Spring BeanUtils Copy Failed

Local environment: - spring-core: 6.0.2 - spring-bean: 6.0.2 - openjdk 17.0.2

Comment From: spring-projects-issues

If you would like us to look at this issue, please provide the requested information. If the information is not provided within the next 7 days this issue will be closed.

Comment From: spring-projects-issues

Closing due to lack of requested feedback. If you would like us to look at this issue, please provide the requested information and we will re-open the issue.