Hi, All.
I can get object with specified class in HQL like this:
Code:
from Animal as a where a.class = Cat
How can i do this in Criteria Query?
This code is finished with error "java.lang.IllegalArgumentException: Illegal attempt to dereference path source [null]":
Code:
Root<Animal> root = criteria.from(Animal.class);
criteria.where( builder.equal( root.get("class"), "Cat" ) );
And also this code is finished with same error:
Code:
Root<Animal> root = criteria.from(Animal.class);
criteria.where( builder.equal( root.get("class"), Cat.class ) );