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, tools, and much more.

Current Customers and Partners

Log in for full access

Log In

New to Red Hat?

Learn more about Red Hat subscriptions

Using a Red Hat product through a public cloud?

How to access this content