2

I am creating a specification which returns the records for the ids provided by the db function GET_RECORD_IDS. I am providing my code snippet below-

return ((root, query, criteriaBuilder) -> criteriaBuilder.and(root.get("id").in(
criteriaBuilder.function("GET_RECORD_IDS", List.class, criteriaBuilder.literal(str))))

But this code results in the error set-returning functions are not allowed in WHERE. How do I make this work?

1 Answer 1

2

I found out that the following code makes it work-

return ((root, query, criteriaBuilder) -> criteriaBuilder.and(root.get("id").in(
criteriaBuilder.function("select id from GET_RECORD_IDS", List.class, criteriaBuilder.literal(str))))
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.