This content has been marked as final.
Show 2 replies
-
1. Re: JPQL issue - org.hibernate.QueryParameterException: coul
jaikiran Jun 4, 2008 7:41 AM (in response to jope)"JoPe" wrote:
The only difference I can notice between the two queries is that in the second one I'm using a fully qualified name for the persisted Entity because the class is defined in a different package. Maybe Hibernate gets confused by that?
Can anybody give me a hint? I'm totally out of ideas.
From what i remember, this is a case of Hibernate reporting the wrong error message. I guess, the actual error is "mapping not found for green20.demo.items.Item". Try this query:String queryString2 = "select itm from green20.demo.items.Item itm";
This probably will show you the correct error message. And once you fix that, you can change it to accept the parameters. -
2. Re: JPQL issue - org.hibernate.QueryParameterException: coul
jope Jun 4, 2008 4:51 PM (in response to jope)Thank you, jaikiran!
You were almost right: The actual error was that the Item class wasn't mapped, which is what made me use the fully qualified name in the first place.
However, note:String queryString2 = "select itm from green20.demo.items.Item itm";
does NOT throw any exception or error message AT ALL (also not in server log). Once I replaced the fully qualified name, it showed the correct exception again.