title: How to get returning ID in JPA after native query insert
body: <p>I have the following code in JPA to return an auto generated ID after inserting using native query:</p>
  
  <pre><code>Query q = em.createNativeQuery("insert into .... returning ID", Long.class);
  q.executeUpdate();
  </code></pre>
  
  <p>However, I'm getting the following error:</p>
  
  <pre><code>A result was returned when none was expected
  </code></pre>