title: How to get jpql of named query?
body: <p>Let say there is the below definition:</p>
  
  <pre><code>@Entity
  @NamedQueries({
      @NamedQuery(name = "name1", query = "SELECT n FROM SomeEntity n where n.name= :name"),
      @NamedQuery(name = "name2", query = "SELECT n FROM SomeEntity n where n.name &lt;&gt; :name")
  })
  public class SomeEntity ......
  </code></pre>
  
  <p>How to programmatically get a definition of the named query ?<br><br>
  For example the bellow code snippet should print a definition of <code>name1</code> query, I don't know how to get this definition in code:</p>
  
  <pre><code>String queryString = ????????.getSqlOfNamedQuery("name1");
  // the below line should print: SELECT n FROM SomeEntity n where n.name= :name
  System.out.println( queryString ); 
  </code></pre>