JPA Query toString

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

+3
source share
2 answers

, , .

DEBUG DataNucleus.Datastore . DataNucleus Logging.

+1

DataNucleus toString() JPA Query, ( ). , , (), SQL RDBMS, - BigTable.

0

Source: https://habr.com/ru/post/1764256/


All Articles