ObjectDB ObjectDB

java.lang.ClassCastException: CriteriaQueryImpl cannot be cast to java.util.List

#1

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.

 

edit
delete
#2

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.

ObjectDB Support
edit
delete
#3
Please delete me
edit
delete
#4

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.

 

ObjectDB Support
edit
delete

Reply

To post on this website please sign in.