java.lang.IllegalArgumentException: An exception occurred while creating a query in EntityManager:

I have created add on project in Jmix 2.5.2 version. I trying to fetch the data from User entity using bellow code

dataManager.load(User.class).query(“select u from User u”).list();

while executing this above code I getting following error.

Caused by: Exception [EclipseLink-0] (Eclipse Persistence Services - 4.0.2-3-jmix.v202404051618): org.eclipse.persistence.exceptions.JPQLException
Exception Description: Problem compiling [select u from User u].
[14, 26] The abstract schema type ‘User’ is unknown.

Hello,

it could be that it’s not “User” but something else, like abc_User , where ABC is your project suffix, check the name of the class in your data model.

Kind regards,
Mladen

As Mladen mentioned, the entity name can differ from the simple class name. Look at the @Entity annotation and its value.