Is there any proper way to use arithmetic methods (sum, avg, etc.) of CriteriaBuilder class with a String property (VARCHAR column) of an Entity class?
Here is related field:
@Column(name="GRADE")
private String grade;
And what I want to do is:
Expression ex = criteriaBuilder.avg(root.get("grade");