title: JPA, get all elements
body: <p>I'm using JPA  and I get all elements from DB in this code:</p>
  
  <pre><code>factory = Persistence.createEntityManagerFactory(PERSISTENCE_UNIT_NAME);
  EntityManager em = factory.createEntityManager();
  // read the existing entries and write to console
  Query q = em.createQuery("select s from Supporter s");
  List&lt;Supporter&gt; supportersList = new ArrayList&lt;Supporter&gt;();
  supportersList = q.getResultList();
  </code></pre>
  
  <p>And the question is how to get data in more elegant way, I mean without <code>createQuery("select s from Supporter s");</code>
  As I remember there are somewhere methods like findAll or getAll to use in JPA when case is 'clear' and we don't need native queries.</p>