List<Product> list = new LinkedList<>();
Query query = session.createQuery("from Product");
for(final Object o : query.list()) {
list.add((Product)o);
}
Session session;
EntityManager em = session.getEntityManagerFactory().createEntityManager();
TypedQuery<Product> query = em.createQuery("from Product", Product.class);
List<Product> list = query.getResultList();