0
I’m having a problem in java giving the following error:
in class: com.app.myApp.ReportDTO, setter method of property: indicator
expected type: java.lang.Double, actual value: java.lang.IntegerInteger
Which occurs in my criteria, when creating a projector, setando a projection as SUM:
projectionList.add(Projections.sum(propertyIndicator), "indicator");
By giving the criteria.List();
the error is popped. The strange thing is that when I used avg function, instead of sum, it worked normally, without error.
From what I’ve seen, the error occurs because my propertyIndicator
is a Integer, and the Property "indicator"
is a Double. I can perform the conversion of these properties in the function sum?
What parameters
projectionList.add
accepted?– Krismorte
it accepts several parameters, the problem is that sum vc puts the string with the name of the property, that this can be any type of parameter. That’s why you couldn’t do a conversion inside the sum
– Erico Souza