Error on compiling query: The abstract schema type 'entity' is unknown

In my case I forgot to register it in persistence.xml.


I just had the very same situation but my JPQL query was correct ! It occured in Glassfish 4.1 (build 13) (with EclipseLink).

After a few googling and some code commenting, I found out that the root cause of "The abstract schema type 'MyEntity' is unknown" was some use of Java 8 lambda code inside the entity class.

It seems that any feature of Java 8 is not (yet) supported in the version of EclipseLink that comes with GF. More info, see the bug report on that.

Hope this helps.


You should have

SELECT g FROM Game g//you have game

but you have game instead of Game.

The @Table annotation is used for DB.

If you need to change the name in your JPQL, use the @Entity annotation: @Entity(name="nameUsedInJPQL") => nameUsedInJPQL is used in your JPQL.

If you do not specify anything in your @Entity, that the case-sensitive Entity class name is used.