[
https://issues.apache.org/jira/browse/OPENJPA-2468?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Kevin Sutter resolved OPENJPA-2468.
-----------------------------------
Resolution: Incomplete
You mention that this capability is documented somewhere. Can you clarify
where you saw this documentation? I just checked the OpenJPA documentation and
I don't see the CONCAT being used with the IN operator. And, when I check the
JPA 2.0 spec, the BNF seems pretty clear that this capability is not defined.
Excerpts from the BNF:
comparison_expression ::=
string_expression comparison_operator {string_expression |
all_or_any_expression} | ...
comparison_operator ::= = | > | >= | < | <= | <>
string_expression ::= string_primary | (subquery)
string_primary ::=
state_field_path_expression |
string_literal |
input_parameter |
functions_returning_strings | ...
functions_returning_strings ::=
CONCAT(string_primary, string_primary {, string_primary}*) | ...
The key is what comparison_operators are defined for string comparisons.
If you are finding other examples or interpretations of the spec, please
provide them and re-open this JIRA. Thanks.
> JPQL Functions (CONCAT, TRIM, etc) doesnt works with IN clause
> ---------------------------------------------------------------
>
> Key: OPENJPA-2468
> URL: https://issues.apache.org/jira/browse/OPENJPA-2468
> Project: OpenJPA
> Issue Type: Bug
> Components: jdbc
> Reporter: Amol Bhosale
>
> I was triying to use functions in my query as per the documentations however
> was getting errors when Functions are used with IN clause, same functions do
> work with comparator!!
> Consider 2 entities
> Employee[empId, lastName, firstName, mgrID] and
> Manager[mgrId, empId]
> Failing query
> Select e from Employee e where CONCAT(firstName, lastName) IN
> ('First1Last1', 'First2Last2')
> working Query
> Select e from Employee e where CONCAT(firstName, lastName) = 'First1Last1'
> OR CONCAT(firstName, lastName) = 'First2Last2'
--
This message was sent by Atlassian JIRA
(v6.1.5#6160)