public Map<String, Object> parameters() { return function.parameters(); }
public Filter(String propertyName, FilterFunction filterFunction, ComparisonOperator comparisonOperator) { this.index = 0; this.propertyName = propertyName; this.function = filterFunction; this.function.setFilter(this); this.comparisonOperator = comparisonOperator; }
/** * @param nodeIdentifier The node identifier * @param addWhereClause The add where clause. * @return The filter state as a CYPHER fragment. */ public String toCypher(String nodeIdentifier, boolean addWhereClause) { String fragment = this.function.expression(nodeIdentifier); String suffix = isNegated() ? negate(fragment) : fragment; return cypherPrefix(addWhereClause) + suffix; }
/** * Returns the result of passing the property value through the transformer associated with the comparison operator * on this {@link Filter}. * * @return The transformed property value */ public Object getTransformedPropertyValue() { Object value = this.function.getValue(); if (this.getPropertyConverter() != null) { value = this.getPropertyConverter().toGraphProperty(value); } else if (this.getCompositeAttributeConverter() != null) { throw new MappingException("Properties with a CompositeAttributeConverter are not supported by " + "Filters in this version of OGM. Consider implementing a custom FilterFunction."); } return transformPropertyValue(value); }
private static void appendFilters(List<Filter> filters, String nodeIdentifier, StringBuilder query, Map<String, Object> properties) { for (Filter filter : filters) { query.append(filter.toCypher(nodeIdentifier, false)); properties.putAll(filter.getFunction().parameters()); } } }
public void setFunction(FilterFunction function) { assert function != null; this.function = function; this.function.setFilter(this); }