I am using Spring Framework .
While writing custom queries, I am unable check a parameter of boolean value.
For example this is not working:
<isEqual property="booleanVariable" compareValue="0">
do some SQl codes
</isEqual>
The above checking is not working, it is evaluating as equal in both the cases when booleanVariable is true and false .
I tried to replace compareValue="true" and “false”.
Is it possible to check the boolean property in XML like above?
Use
<isEqual property="booleanVariable" compareValue="true/false">to compare boolean values.In java a boolean has no relationship to 1 or 0. The primitive type is always true or false