I can\'t make this query work:
Query query = eManager.createQuery(\"select c FROM News c WHERE c.NEWSID = :id\",News.class);
return (News)query.setPara
That happens because News
entity does not have persistent attribute named NEWSID
. Names of the persistent attributes are case sensitive in JPQL queries and those should be written with exactly same case as they appear in entity.
Because entity have persistent attribute named newsId
, that should also be used in query instead of NEWSID
:
select c FROM News c WHERE c.newsId = :id