title: EntityManager#getResultList() returns an empty list
body: <p>I'm working on my first web shop and have trouble to retrieve objects when searching for them. Searching for an existing product results in that the list productHits remains empty.</p>
  
  <p>(To read the whole project please see <a href="https://github.com/gitsjogren/TareaWebShop" rel="nofollow">https://github.com/gitsjogren/TareaWebShop</a>)</p>
  
  <p>Here's the product catalogue:</p>
  
  <pre><code>public final class ProductCatalogue extends AbstractDAO&lt;Product, Long&gt; implements IProductCatalogue {
  
      private static EntityManagerFactory emf = Persistence.createEntityManagerFactory("shop_pu");
      private static Product p1;
      private static Customer c1;
  
  @Override
      public List&lt;Product&gt; search(String searchWord){
          EntityManager em = emf.createEntityManager();
          List&lt;Product&gt; prodHits = new ArrayList&lt;&gt;();
          try {
              String sqlQuery = "SELECT p FROM Product p WHERE p.name LIKE :theSearch";
              TypedQuery&lt;Product&gt; q = em.createQuery(sqlQuery, Product.class);
              String searchQuery = "%" + searchWord + "%";
              q.setParameter("theSearch", searchQuery);
              prodHits = (List&lt;Product&gt;) q.getResultList();
          } catch (Exception e) {
              System.out.print(e);
          }
          em.close();
          return prodHits;
  }    
  </code></pre>
  
  <p>I have also tried using a NativeQuery instead of a TypedQuery, with no luck.</p>
  
  <pre><code>Query q = em.createNativeQuery(sqlQuery, Product.class);
  </code></pre>