createQuery « EntityManager « JPA Q&A





1. JPA EntityManager createQuery() with IN not working    stackoverflow.com

About to kill myself here. This is failing:

List<String> names = new ArrayList<String>();
names.add("sold");
Query query = em.createQuery("FROM PropField propField WHERE propField.name IN (?)");
query.setParameter(1, names);
List<PropField> fields = query.getResultList();
And so is this:
List<String> names = new ArrayList<String>();
names.add("sold");
Query ...

2. What is the difference between enitityManager.find and entityManager.createQuery?    stackoverflow.com

Ok, I was using EJB 3.0 with hibernate, we dropped our .ear file into Easy-Beans 1.0.1 (with Hibernate) deploy directory embedded into Apache Tomcat 6.0.18. So my database had to persist things ...

3. JPA EntityManager createQuery returns no results    stackoverflow.com

The following line is attempting to retrieve all rows from the database table "Sourcing" using a JPA Container-Managed JPA2.0 EntityManager, however it returns no results, even though there appear to be ...

4. EntityManager.createQuery barfs on COUNT(CASE statement    forum.hibernate.org

" COUNT ( DISTINCT CASE WHEN (cs.serveTs BETWEEN :beginTs AND :endTs ) THEN cs.componentId ELSE NULL END ) " " COUNT ( DISTINCT (CASE WHEN (cs.serveTs BETWEEN :beginTs AND :endTs ) THEN cs.componentId ELSE NULL END ) ) " " COUNT ( CASE WHEN (cs.serveTs BETWEEN :beginTs AND :endTs ) THEN cs.componentId ...