No entity variable name [Variable: null]


Where I run a jpql query in a service I get the following error

Caused by: Errors found for input JPQL:[select c from salesordermngmt_Counterparties] No entity variable name [Variable: null]

The entity salesordermngmt_Counterparties exist

see below for code snippet

    try(Transaction tx = persistence.getTransaction("gcsblotter")) {

        EntityManager em = persistence.getEntityManager("gcsblotter");

        Query q = em.createQuery("select c from salesordermngmt_Counterparties");


Please help ! - Thanks

You forgot to “alias” your entity

select c from salesordermngmt_Counterparties c

Thanks Giuseppe works great !