1Z0-898 · Question #23
A developer wants to create a Java Persistence query that will include a sub-query. Which three are true? (Choose three.)
The correct answer is B. Sub-queries can be used in a WHERE clause. C. The ANY expression can be used only with a sub-query. D. The EXISTS expression can be used only with a sub-query. B (not A): Subqueries can be used in the Criteria API in the select, where, order, group by, or CD: A subQuery is created from a CriteriaQuery using the subQuery operation. Most subQuery usage restricts the subQuery to returning a single result and value, unless used with the…
Question
A developer wants to create a Java Persistence query that will include a sub-query. Which three are true? (Choose three.)
Options
- ASub-queries can be used in a FROM clause.
- BSub-queries can be used in a WHERE clause.
- CThe ANY expression can be used only with a sub-query.
- DThe EXISTS expression can be used only with a sub-query.
- EThe MEMBER expression can be used only with a sub-query.
How the community answered
(23 responses)- A4% (1)
- B83% (19)
- E13% (3)
Explanation
B (not A): Subqueries can be used in the Criteria API in the select, where, order, group by, or CD: A subQuery is created from a CriteriaQuery using the subQuery operation. Most subQuery usage restricts the subQuery to returning a single result and value, unless used with the CriteriaBuilder exists, all, any, or some operations, or with an in operation.
Topics
Community Discussion
No community discussion yet for this question.