Maxim Solodovnik created OPENJPA-2980:
-----------------------------------------
Summary: addNamedQuery relabels criteria query as JPQL
Key: OPENJPA-2980
URL: https://issues.apache.org/jira/browse/OPENJPA-2980
Project: OpenJPA
Issue Type: Sub-task
Components: jpa
Affects Versions: 4.2.0
Reporter: Maxim Solodovnik
Fix For: 4.2.0
Discussion thread:
https://github.com/apache/openjpa/pull/144#discussion_r3683005009
**(medium)** `addNamedQuery` re-labels a criteria query as JPQL using
`queryImpl.getQueryString()`, which for criteria queries is the CQL/toString
rendering - OpenJPA has never guaranteed that string is parseable JPQL
(parameter rendering, literals, treated paths). Has this been exercised beyond
simple queries? The three `catch (Exception) { // ignore }` blocks below (lines
512-540) would also hide genuine failures - they could be narrowed to
IllegalStateException where the spec defines it.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)