tarmogoyf
tarmogoyf

Reputation: 337

Spring spel in open projection

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!

Upvotes: 1

Views: 464

Answers (1)

Related Questions