Your observation is correct - this is the result of querying a class with no instances in the database.
In standard JPA the solution is to list all the managed classes in advance.
In ObjectDB you can also introduce the new class before query execution by using:
but this is not a portable JPA code.
Update (starting ObjectDB 2.2): em.getMetamodel().entity(User.class) is preferred.
Regarding Extent in JPA, your "SELECT a FROM User a" query is the standard replacement of JPA for JDO extents.
Alternatively, if you want, you may use JDO from JPA application by obtaining PersistenceManager from your EntityManager:
ObjectDB - Fast Object Database for Java (JPA/JDO)