r12*_*123 6 hibernate jpa spring-mvc spring-data-jpa spring-boot
我有一个具有多个属性路径的实体.我使用Query By Example和ExampleMatcher忽略了一些属性路径.
我的实体如下所示,Employee.class
private Integer id;
private String name;
private String designation;
Run Code Online (Sandbox Code Playgroud)
我想只显示实体中的Name和Id(表中的字段).为此,我做了以下,
ExampleMatcher exampleMatcher = ExampleMatcher.matching().withIgnoreNullValues().withIgnorePaths("designation");
Example<Employee> example = Example.of(entity, exampleMatcher);
Run Code Online (Sandbox Code Playgroud)
但是,响应返回所有值,包括ignorePath中给出的属性.
请帮助我如何忽视物业路径.
| 归档时间: |
|
| 查看次数: |
902 次 |
| 最近记录: |