use of com.evolveum.midpoint.repo.sql.query.hqm.condition.ConstantCondition in project midpoint by Evolveum.
the class PropertyRestriction method interpretInternal.
@Override
public Condition interpretInternal() throws QueryException {
JpaPropertyDefinition propertyDefinition = linkDefinition.getTargetDefinition();
if (propertyDefinition.isLob()) {
throw new QueryException("Can't query based on clob property value '" + linkDefinition + "'.");
}
String propertyValuePath = getHqlDataInstance().getHqlPath();
if (filter.getRightHandSidePath() != null) {
return createPropertyVsPropertyCondition(propertyValuePath);
} else {
Object value = getValueFromFilter(filter);
if (value == null && propertyDefinition.isNeverNull()) {
LOGGER.warn("Checking nullity of non-null property {} (filter = {})", propertyDefinition, filter);
return new ConstantCondition(context.getHibernateQuery(), false);
} else {
Condition condition = createPropertyVsConstantCondition(propertyValuePath, value, filter);
return addIsNotNullIfNecessary(condition, propertyValuePath);
}
}
}
Aggregations