Please follow the posting instructions and use a separate thread for each subject.
Your new question is not related to your original topic from 4 months ago, and therefore should not be discussed in this thread.
Please follow the posting instructions and use a separate thread for each subject.
Your new question is not related to your original topic from 4 months ago, and therefore should not be discussed in this thread.
The select method returns a CriteriaQuery instance (to be used for additional chained query building operations), not results.
To execute the query you have to create a TypedQuery (or Query) instance from your CriteriaQuery and then execute the query using getResultList:
criteriaQuery.select(root); TypedQuery<Person> query = em.createQuery(criteriaQuery); allPersons = query.getResultList();
For more details see this manual page.
Please follow the posting instructions and use a separate thread for each subject.
Your new question is not related to your original topic from 4 months ago, and therefore should not be discussed in this thread.