Operand of * is of type 'java.lang.Boolean' which is not a numeric type

Hi,

we use in some queries the boolean values as integer/double values but now it throws Operand of * is of type 'java.lang.Boolean' which is not a numeric type. How should we resolve it? I think it is quite normal to use the boolean as 0/1 values.

This is not normal at all. You should use a case expression to produce the desired result instead e.g. case when entity.booleanAttribute then 1 else 0 end

Recasting the column as an integer works for me.
I think in this case it should work same like the case expression.

Strict typing is there to prevent user errors. Maybe you mistyped your query with such implicit conversions, you’re going to potentially miss out on your error.

Just use casting or a case expression please. That will also make it clearer for readers.