title: JPA Query toString
body: <p>I have a JPA Query I am executing on the Google App-Engine datastore.<br>
  I am building the query using parameters.<br>
  After all parameters have been inputted, I wish to view the Query String.</p>
  
  <p>That is, I wish to view the actual query being executed by the datastore.<br>
  Is that even possible?
  It would really help me in debugging.</p>
  
  <p>To SOLVE the question, assume the following query:</p>
  
  <pre><code>Query query=EM.createQuery("SELECT FROM "
  +MyClass.class.getName()+" C WHERE C.field = :arg1");
  query.setParameter("arg1", someParam);
  </code></pre>
  
  <p>if <code>System.out.println(SomeObj)</code> prints 'SELECT FROM MyClass C WHERE C.field = 17'
  then the question is solved.</p>
  
  <p>David</p>