Package org.neo4j.ogm.cypher.function
Class ContainsAnyComparison
java.lang.Object
org.neo4j.ogm.cypher.function.ContainsAnyComparison
- All Implemented Interfaces:
FilterFunction<Object>
Filter to allow searching in collection properties.
The difference with the IN filter is that the IN has a single parameter value, whereas
ContainsAny value can be a collection and will match against properties
containing at least one of these values.
For example
Filter f = new Filter("specialities", new ContainsAnyComparison(Arrays.asList("burger", "sushi"))); Collection<Restaurant> all = session.loadAll(Restaurant.class, new Filters(f));will match all restaurant having burger OR sushi as a speciality.
- Author:
- Gerrit Meier, Michael J. Simons
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionexpression
(String nodeIdentifier, String filteredProperty, UnaryOperator<String> createUniqueParameterName) Generates a cypher expression for this functiongetValue()
parameters
(UnaryOperator<String> createUniqueParameterName, PropertyValueTransformer propertyValueTransformer) Provides the map of parameters to use.
-
Field Details
-
PARAMETER_NAME
- See Also:
-
-
Constructor Details
-
ContainsAnyComparison
-
-
Method Details
-
getValue
- Specified by:
getValue
in interfaceFilterFunction<Object>
-
expression
public String expression(String nodeIdentifier, String filteredProperty, UnaryOperator<String> createUniqueParameterName) Description copied from interface:FilterFunction
Generates a cypher expression for this function- Specified by:
expression
in interfaceFilterFunction<Object>
- Parameters:
nodeIdentifier
- The identifier of the node to be filtered in the queryfilteredProperty
- The identifier of the filtered propertycreateUniqueParameterName
- An operator to create unique parameter names, the same as inFilterFunction.parameters(UnaryOperator, PropertyValueTransformer)
- Returns:
- The fragment to use
-
parameters
public Map<String,Object> parameters(UnaryOperator<String> createUniqueParameterName, PropertyValueTransformer propertyValueTransformer) Description copied from interface:FilterFunction
Provides the map of parameters to use. It is advised to use the provided operator for creating unique parameter names- Specified by:
parameters
in interfaceFilterFunction<Object>
- Parameters:
createUniqueParameterName
- An operator to create unique parameter namespropertyValueTransformer
- Transformer for adapting possible values to the domain- Returns:
- The map of parameters
-