title: How to map a Native Query to a POJO, when I do not have any Entity on my project?
body: <p>I am translating an ETL process from a tool to a Java batch API application. In this ETL process. In the current version (using the tool) we have many SQL statements that join different tables in order to generate the desired output. Translating to Java, JPA is now available.</p>
  
  <p>I would like to use native queries. This would be nice because it would not require creating entities for every table used in the query and I could use POJOs for the result of the queries (also, I would not need to rewrite the queries). Reading <a href="https://stackoverflow.com/questions/13012584/jpa-how-to-convert-a-native-query-result-set-to-pojo-class-collection/21487061#21487061">this answer</a> I know I could use <code>@SqlResultSetMapping</code>. The problem is that I do not have any entity in my project, so I do not know where to put this annotation. Is there anywhere I can put this annotation so the entity manager finds it?</p>
  
  <p>PS: in my proof of concepts I am currently manually converting from an array of objects to the POJO, but I really don't like this approach.</p>
  
  <p>Adding the <code>@Entity</code> annotation to the POJO will cause my application not to start:</p>
  
  <blockquote>
    <p>Caused by: org.hibernate.HibernateException: Missing table: MyTable</p>
  </blockquote>
  
  <p>I am not sure (searching for it right now), but I think it could be caused by this property in my persistence.xml</p>
  
  <pre><code>&lt;property name="hibernate.hbm2ddl.auto" value="validate"/&gt;
  </code></pre>