use of com.evolveum.midpoint.repo.sql.query2.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.
*
* Such a filter has to be treated like
*
* NOT (PROPERTY=VALUE & PROPERTY IS NOT NULL)
*
* TODO implement for restrictions other than PropertyRestriction.
*/
protected 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