[hibernate-issues] [Hibernate-JIRA] Commented: (EJB-361) Query#setParameter(int position, Object value) wrong implementation

John Sublette (JIRA) noreply at atlassian.com
Fri Aug 7 14:46:15 EDT 2009


    [ http://opensource.atlassian.com/projects/hibernate/browse/EJB-361?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=33729#action_33729 ] 

John Sublette commented on EJB-361:
-----------------------------------

Missed a potential problem
"SELECT Foo FROM Foo WHERE Foo.param1 = ? AND Foo.param2 = 5" FALSE (found index is followed by a non-digit (space) -- should be true, right?) 

> Query#setParameter(int position, Object value) wrong implementation
> -------------------------------------------------------------------
>
>                 Key: EJB-361
>                 URL: http://opensource.atlassian.com/projects/hibernate/browse/EJB-361
>             Project: Hibernate Entity Manager
>          Issue Type: Bug
>          Components: EntityManager
>    Affects Versions: 3.3.2.GA
>            Reporter: Fabrice Daugan
>   Original Estimate: 2 hours
>  Remaining Estimate: 2 hours
>
> The Hibernate JPA javax.persistence.Query#setParameter(int position, Object value) implementation does not suit to the JPA specicafication.
> Indeed, the actual integer passed to the operation is converted to String by Hibernate and then used to find the named parameter.
> Please have a look to the folowing stack trace :
> java.lang.Thread.run(Thread.java:619) 
> Caused by: java.lang.IllegalArgumentException: 
> org.hibernate.QueryParameterException: could not locate named parameter [1] 
> at org.hibernate.ejb.QueryImpl.setParameter(QueryImpl.java:185) 
> at org.hibernate.ejb.QueryImpl.setParameter(QueryImpl.java:240) 
> at org.springframework.orm.jpa.JpaTemplate$9.doInJpa(JpaTemplate.java:316)
> To repoduce this error :

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://opensource.atlassian.com/projects/hibernate/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        


More information about the hibernate-issues mailing list