Hi all,
Im using the above method to get a named query.
Named query.......
@NamedQuery(name = "Task.findByStatus", query = "SELECT t FROM Task t WHERE t.status = :status")
Function call.........
return (Task) getJpaTemplate().findByNamedQuery("Task.findByStat us","NEW");
Error...........
Caused an ERROR
You have attempted to set a parameter at position 1 which does not exist in this query string SELECT t FROM Task t WHERE t.status = :status.; nested exception is java.lang.IllegalArgumentException: You have attempted to set a parameter at position 1 which does not exist in this query string SELECT t FROM Task t WHERE t.status = :status.
org.springframework.dao.InvalidDataAccessApiUsageE xception: You have attempted to set a parameter at position 1 which does not exist in this query string SELECT t FROM Task t WHERE t.status = :status.; nested exception is java.lang.IllegalArgumentException: You have attempted to set a parameter at position 1 which does not exist in this query string SELECT t FROM Task t WHERE t.status = :status.
Caused by: java.lang.IllegalArgumentException: You have attempted to set a parameter at position 1 which does not exist in this query string SELECT t FROM Task t WHERE t.status = :status.
at oracle.toplink.essentials.internal.ejb.cmp3.base.E JBQueryImpl.setParameterInternal(EJBQueryImpl.java :633)
at oracle.toplink.essentials.internal.ejb.cmp3.EJBQue ryImpl.setParameter(EJBQueryImpl.java:194)
at org.springframework.orm.jpa.JpaTemplate$11.doInJpa (JpaTemplate.java:343)
at org.springframework.orm.jpa.JpaTemplate.execute(Jp aTemplate.java:191)
at org.springframework.orm.jpa.JpaTemplate.executeFin d(JpaTemplate.java:158)
at org.springframework.orm.jpa.JpaTemplate.findByName dQuery(JpaTemplate.java:338)
......................
I also tried with hibernate but no luck same error.
org.hibernate.HibernateException: could not parameter[1].......something similar to this
I would really appreciate if anyone has seen this kind of error and could help me out.
Thanks
Sri


Reply With Quote
