Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Hibernate : QueryParameterException could not locate named parameter

 
Jehan Jaleel
Ranch Hand
Posts: 196
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I have a native SQL query which I want to execute through Hibernate...



The above code is leading to below exception....



createdBy is a column in the Run table and in the Run JPA entity, so I really do not know why it is not identifying it as a parameter.

Thanks in advance for any help.
 
James Boswell
Bartender
Posts: 1051
5
Chrome Eclipse IDE Hibernate
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Looking at the Hibernate docs, you can have either positional or named parameters when using native queries.

Positional

Named

Looking at your code, you will need something like this:
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic