Hi,
I have a simple HQL query statement that I expect to work with no problem but I just could not get thru this queryException. I hope extra pair of eyes can help spot my wrong doings right away.
Cause of Exception:
org.hibernate.QueryException: Not all named parameters have been set: [conId] [SELECT Consumer FROM Consumer AS consumer WHERE consumer.conId = :conId]
Code:
Code:
public static Consumer findConConsumer(Long conId) {
if (conId == null)
return null;
return (Consumer) entityManager().createQuery("SELECT Consumer FROM Consumer AS consumer WHERE consumer.conId = :conId").getSingleResult();
//return (Consumer) entityManager().createQuery("select o from Consumer o as o where o.conId = :con_Id").getSingleResult();
I debugged to make sure that [conId] was indeed passed in and with the right value. Indeed it was.
Any ideas and info would be greatly appreciated.