Win a copy of Java 9 Modularity: Patterns and Practices for Developing Maintainable Applications this week in the Java 9 forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Hibernate : QueryParameterException could not locate named parameter  RSS feed

 
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
Boost this thread!