My goal is to combine map from some spring data projection. Entity:
@Entity
public class Parent {
// id, getters and boilerplate
private List<Child> childs
}
and projection be like:
interface ParentProjection{
@Value("target.childs == null ? null : {target.childs![name]: target.childs![id'})
Map<String,Long> getChildNameAndId();
}
It compiles but when it reaches getChildAndId() in application it falls with : java.lang.IllegalArgumentException: Projection type must be an interface!