| Summary: | SQL generation for subquery built using Criteria API causes "the expression builder is missing" exception | ||
|---|---|---|---|
| Product: | z_Archived | Reporter: | Mikhail Skotnikov <Mikhail.Skotnikov> |
| Component: | Eclipselink | Assignee: | Project Inbox <eclipselink.orm-inbox> |
| Status: | NEW --- | QA Contact: | |
| Severity: | normal | ||
| Priority: | P2 | CC: | Mikhail.Skotnikov, tom.ware |
| Version: | unspecified | ||
| Target Milestone: | --- | ||
| Hardware: | PC | ||
| OS: | Windows 7 | ||
| Whiteboard: | |||
|
Description
Mikhail Skotnikov
The same issue was reproduced in the version 2.2.0 It is not clear to me what query you are running. We have a number of tests that use subqueries with criteria API that pass. The code you have supplied to create the query is incomplete - I cannot tell what the outer query is.(e.g. what does queryAccessor.getIntermediateQuery(); return?) Please provide either a complete set of code to build a query that will fail with the noted exception or complete JPQL for a query that will fail. Setting target and priority. See the following page for the meanings of these fields: http://wiki.eclipse.org/EclipseLink/Development/Bugs/Guidelines Note: You still have not provided complete code that allows us to build the query causing the problem. That may hinder our attempts to recreate and fix this problem. Community: Please vote for this bug if it is important to you. Votes are one of the main criteria we use to determine which bugs to fix next. The complete source code generating the query using Criteria API is rather broad and not easy to understand, so I put JPQL equivalent of what it tried to build:
SELECT a
FROM Armor a JOIN a.item i LEFT JOIN i.nameMsg m
ORDER BY (CASE WHEN EXISTS (SELECT lm.text
FROM m.localizations lm1
WHERE lm1.locale.id = :userLocale)
THEN (SELECT lm.text
FROM m.localizations lm2
WHERE lm2.locale.id = :userLocale)
WHEN EXISTS (SELECT lm.text
FROM m.localizations lm3
WHERE lm3.locale.id = :defLocale)
THEN (SELECT lm.text
FROM m.localizations lm4
WHERE lm4.locale.id = :defLocale)
ELSE m.name
END)
I also noted a problem when a literal expression is used in any case expression part => it causes the infinite loop.
Again, all that was experienced when queries were built using Criteria API.
This particular query is not blocking, as it was re-written to call a PLSQL function encapsulating the subqueries, but the problem experienced may be encountered in another scenario if it is not analyzed.
The Eclipselink project has moved to Github: https://github.com/eclipse-ee4j/eclipselink |