JpaSpecificationExecutorWithProjection.findAll(Specification spec, Class projectionType, Pageable pageable) returns duplicates
my entity:
public class A {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Long id;
private String name;
@OneToMany
private Set<B> list;
....
}
public class B {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Long id;
private String name;
@ManyToOne
private A resource;
....
}
public interface SummaryA{
public String getName();
public Set<SummaryB> getList();
interface SummaryB {
public String getName();
}
}
when I run the search with aRepositoy.findAll I get the following result:
JpaSpecificationExecutorWithProjection.findAll(Specification spec, Class projectionType, Pageable pageable) returns duplicates
my entity:
when I run the search with aRepositoy.findAll I get the following result:
but the expected result was the following: