title: The primary key read from the row is null
body: <p>I am using jpa and trying to do a native named query here is my query</p>
  
  <pre><code>@NamedNativeQuery(name="getDataByList", query="SELECT DISTINCT   
  p.SHIPMENT_NUMBER, p.PO_NUMBERS FROM Packing_Data p WHERE p.PACKING_ID = ?1", 
  resultClass = PackingData.class)
  </code></pre>
  
  <p>I am getting this error <code>The primary key read from the row [ArrayRecord(</code> becuase I am not selecting the primary key from the <code>Packing_Data</code> table, but I a select that column then the <code>DISTINCT</code> part not longer works?</p>
  
  <p>How get I select distinct rows?</p>
  
  <p>Thanks</p>