Sign in

Google Cookbook - Google App Engine

JPQL should use full class name
Posted by genewoo on Tue 14 Apr 2009 in Datastore
User ratings:
EntityManager em = emf.createEntityManager();
Query query = em
.createQuery("select t from com.genewoo.entity.TestEntity t");
List result = query.getResultList();
StringBuffer sb = new StringBuffer();
for (TestEntity testEntity : result) {
sb.append(testEntity.getName()).append("");
}
em.close();



if you use TestEntity directly, you will get an exception message of "TestEntity". From log it will tell you the root cause is:
Caused by: org.datanucleus.exceptions.ClassNotResolvedException: TestEntity

Comments (1)

Sign in to add comment.
1
But if I do this, instead of ClassNotResolvedException I get:

Caused by: org.datanucleus.store.exceptions.NoTableManagedException: Persistent class "Class com.frinika.server.entity.Composer does not seem to have been enhanced. You may want to rerun the enhancer and check for errors in the output." has no table in the database, but the operation requires it. Please check the specification of the MetaData for this class.
Comment by pjsalomonsen on Fri 22 May 2009 6:20 p.m.