Situation: When I restrict one of my audit queries with »query.add(AuditEntity.property("parent").isNull())« the SQL generated at execution time says somthing like »parent_id = ?« instead of »parent_id is null«. Please note that the property »parent« here is a foreign key to another audited entity.
I tried to replace the equality-operator in case of a null-value with the is-operator in the Java classes »NullAuditExpression«, method »addToQuery« and »AbstractIdMapper«, methods »addIdEqualsToQuery« / »addNamedIdEqualsToQuery«.
The point is that altough it now reads now
parameters.addWhereWithParam(propertyName, " is ", null);
if (paramData.getValue() != null) { parametersToUse.addWhereWithNamedParam(paramData.getProperty(prefix), equals ? "=" : "<>", paramData.getQueryParameterName()); } else { parametersToUse.addWhereWithNamedParam(paramData.getProperty(prefix), equals ? " is " : " is not ", paramData.getQueryParameterName()); }
Hello,
unfortunately I can't think of any reasons for this without debugging ...
Adam