use of com.evolveum.midpoint.repo.sql.query.hqm.condition.IsNotNullCondition in project midpoint by Evolveum.
the class ItemValueRestriction method addIsNotNullIfNecessary.
/**
* Filter of type NOT(PROPERTY=VALUE) causes problems when there are entities with PROPERTY set to NULL.
* <p>
* Such a filter has to be treated like
* <p>
* NOT (PROPERTY=VALUE & PROPERTY IS NOT NULL)
* <p>
* TODO implement for restrictions other than PropertyRestriction.
*/
Condition addIsNotNullIfNecessary(Condition condition, String propertyPath) {
if (condition instanceof IsNullCondition || condition instanceof IsNotNullCondition) {
return condition;
}
if (!isNegated()) {
return condition;
}
RootHibernateQuery hibernateQuery = getContext().getHibernateQuery();
AndCondition conjunction = hibernateQuery.createAnd();
conjunction.add(condition);
conjunction.add(hibernateQuery.createIsNotNull(propertyPath));
return conjunction;
}
Aggregations