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

Fabrice Daugan (JIRA) noreply at atlassian.com
Mon May 19 10:56:33 EDT 2008


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


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