I'm just learning how to get a java google appengine project up and
running and I've run into a problem while attempting to run a query
using JPA. I've followed the instructions on this page
http://code.google.com/appengine/docs/java/datastore/usingjpa.html for
setting up JPA but I'm still running into an exception. In case this
matters I'm running the eclipse app engine plugin version 1.2.2 and I
have only been running in dev mode.I haven't yet deployed the app to
the google servers.
Here is my persistence.xml file:
<persistence-unit name="transactions-optional">
<provider>org.datanucleus.store.appengine.jpa.DatastorePersistenceProvider</
provider>
<properties>
<property name="datanucleus.NontransactionalRead"
value="true"/>
<property name="datanucleus.NontransactionalWrite"
value="true"/>
<property name="datanucleus.ConnectionURL"
value="appengine"/>
</properties>
</persistence-unit>
Here is my Java code:
EntityManager entityManager = EMF.get().createEntityManager();
try
{
String sql = "SELECT t FROM "+Team.class.getName()+" t";
Query query = entityManager.createNativeQuery(sql);
return query.getResultList();
} finally
{
entityManager.close();
}
And here is the exception that I receive:
Caused by: java.lang.IllegalArgumentException: DataNucleus doesnt
currently support queries of language SQL for this datastore
at org.datanucleus.jpa.EntityManagerImpl.createNativeQuery
(EntityManagerImpl.java:724)
This article on the appengine cookbook(http://appengine-
cookbook.appspot.com/recipe/jpql-should-use-full-class-name/) seems to
verify that my query is correct but if that were true why would I
receive the SQL error? Has anyone run into this before?
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Google App Engine for Java" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/google-appengine-java?hl=en
-~----------~----~----~----~------~----~------~--~---