no persistent classes found for query class: ... could not locate named parameter when using "query.setParameter()" method

Solution Verified - Updated -

Issue

When using hibernate function query.setParameter(a,b), log shows error as below:

WARN [org.hibernate.hql.internal.QuerySplitter] (EJB default - 20) HHH000183: no persistent classes found for query class: select t from a.b.c.Test t where t.keyWord = :keyWord
...
Caused by: org.hibernate.QueryParameterException: could not locate named parameter [keyWord]
...

Environment

  • Red Hat JBoss Enterprise Application Platform (EAP)
    • 6.x.0

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase of over 48,000 articles and solutions.

Current Customers and Partners

Log in for full access

Log In
Close

Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.