[ 
https://issues.apache.org/jira/browse/OPENJPA-893?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12670120#action_12670120
 ] 

Pinaki Poddar commented on OPENJPA-893:
---------------------------------------

SQL queries are not parsed by OpenJPA. They are only scanned for parameter 
markers.
Two slightly different falvors of parameter marker is supported: 
a)   "SELECT p FROM Person p WHERE p.name=?1 AND p.age > ?2"
or
b)  "SELECT p FROM Person p WHERE p.name=?1 AND p.age > ?"

In case of (a), the user can number the parameters in a different order than 
they appear in the SQL query string. So, one can do the following
   a2) "SELECT p FROM Person p WHERE p.name=?2 AND p.age > ?1"

While in case of (b), the parameter order is implicit and is same as their 
order of appearance in SQL String.

Recently, we have been modifying in this region of code -- and if you provide 
further details (the SQL query, the parameter naming, the values of the 
parameter you want to set), we can consider implementing it.   


> SQLStoreQuery  does not support named parameters
> ------------------------------------------------
>
>                 Key: OPENJPA-893
>                 URL: https://issues.apache.org/jira/browse/OPENJPA-893
>             Project: OpenJPA
>          Issue Type: Question
>          Components: kernel
>    Affects Versions: 1.1.0
>         Environment: Weblogic 10.3, Oracle 9.2
>            Reporter: Nuno Furtado
>
> I was wondering what was the reason behind this specific StoreQuery not 
> allowing named parameters, and wether there was a way to get around this 
> situation. 
> The original problem was that the TO_DATE Oracle function was not supported 
> by JPQL parser, so i was forced into a native query, and at this point i'm 
> forced to redo the whole query in a somewhat troublesome way, if any of you 
> can provide me with an easy solution i would appreciate it.
> Thank you in advance

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to