1

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!

tarmogoyf
  • 298
  • 3
  • 17

1 Answers1

1

You can search Stackoverflow, there are similar questions with answers that might help you:
"java.lang.IllegalArgumentException: Projection type must be an interface" Error

Spring JPA - "java.lang.IllegalArgumentException: Projection type must be an interface!" (using native query)

Uri Loya
  • 1,181
  • 2
  • 13
  • 34