title: Java converting resultset into Entity
body: <p>I want to get a List of a specific "Type" like "Person" from my JPAConnector.class via a SQL Query (executeQuery Method).</p>
  
  <p>Everything works fine, but if I don't use a SQL Query like "SELECT p from Person p" to get all, in example </p>
  
  <pre><code>SELECT p.name,p.age from Person p
  </code></pre>
  
  <p>then I get as a Resulttype <code>Object[]</code> and not a <code>Person[]</code></p>
  
  <p>I know, that if I don't use every field then my Object is not from Person, but if I execute a query like this </p>
  
  <pre><code>SELECT p.name AS Name, p.age AS Age, p.location AS Location FROM Person p
  </code></pre>
  
  <p>then I don't get an Person Object back, although I used all fields from Person.</p>
  
  <p>I hope you understand my problem, my English is not good. I'm sorry for that.</p>
  
  <p>Greetings
  thunder</p>
  
  <p>Edit: The Background to my Question is, that i want to Average all Columns, where the ID-Column is duplicated ... but that does not has anything to do with my Question ...( only for knowing )</p>