Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Named Query Where clause with a column name containing 'set' does not work #261

Closed
binuv opened this issue May 10, 2013 · 2 comments
Closed
Milestone

Comments

@binuv
Copy link

binuv commented May 10, 2013

The following query throws a PersistenceException("bad jpa query: " + clause);

@NamedQuery(name="findSample",query="SELECT s " +
"FROM Sample s " +
"WHERE s.settlementDate = ?1")

The issue is with com.impetus.kundera.query.KunderaQuery.java

The tokenization has pattern 'set'
List tokens = tokenize(clause, INTRA_CLAUSE_PATTERN);

INTRA_CLAUSE_PATTERN value: =|\blike\b|\bin\b|>=|>|<=|<|set

The tokenization with set will break the WHERE clause as the following tokens
[s., SET, tlementDate, =, ?1]

I do not this side effect was not intended in the code. You might want to modify the "set" in INTRA_CLAUSE_PATTERN to "\bset\b" ( with preceding and following spaces just as you are using like ).

@mevivs
Copy link
Collaborator

mevivs commented May 13, 2013

I will have a look.

-Vivek

@ghost ghost assigned kkmishra May 13, 2013
kkmishra added a commit that referenced this issue Sep 23, 2013
@impetus-opensource-admin
Copy link
Collaborator

Fixed and will be released with 2.8

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants