jpa criteriabuilder upper gives compilation error
As compiler said we it is expecting Expression in this case Path extends from Expression but you have a Path to fix this issue due the following.
return builder.equal(builder.upper(root.<String> get("firstName")), "test".toUpperCase());
Trick is add <String>
before get method, hope that helps.