I have a JPA request that I execute in the Google App Engine datastore.
I am building a query using parameters.
After entering all the parameters, I want to view the query string.
That is, I want to view the actual query executed by the data warehouse.
Is it possible? That would really help me in debugging.
To solve the problem, suppose the following query:
Query query=EM.createQuery("SELECT FROM "
+MyClass.class.getName()+" C WHERE C.field = :arg1");
query.setParameter("arg1", someParam);
if it System.out.println(SomeObj)prints 'SELECT FROM MyClass C WHERE C.field = 17' then the issue is resolved.
David
David source
share