Class Filter

java.lang.Object
org.neo4j.ogm.cypher.Filter
All Implemented Interfaces:
FilterWithRelationship

public class Filter extends Object implements FilterWithRelationship
A parameter along with filter information to be added to a query.
Author:
Luanne Misquitta, Jasper Blues, Michael J. Simons
  • Constructor Details

  • Method Details

    • setNameFromProperty

      public static void setNameFromProperty(Filter filter, String propertyName)
    • getRelationshipDirection

      public Relationship.Direction getRelationshipDirection()
    • setRelationshipDirection

      public void setRelationshipDirection(Relationship.Direction relationshipDirection)
      Specified by:
      setRelationshipDirection in interface FilterWithRelationship
    • getPropertyName

      public String getPropertyName()
    • getBooleanOperator

      public BooleanOperator getBooleanOperator()
    • setBooleanOperator

      public void setBooleanOperator(BooleanOperator booleanOperator)
    • and

      public Filters and(Filter filter)
      Convenience method to chain filters using BooleanOperator.AND.
      Parameters:
      filter - to be chained
      Returns:
      new Filters object containing both filters.
    • or

      public Filters or(Filter filter)
      Convenience method to chain filters using BooleanOperator.OR.
      Parameters:
      filter - to be chained.
      Returns:
      new Filters object containing both filters.
    • ignoreCase

      public Filter ignoreCase()
      Sets this filter to ignore the case in a property comparison when using the EQUALS operator.
      Returns:
      the same filter instance
      Throws:
      IllegalStateException - if the filters function is null, not a property comparison or the operator of the is not an EQUALS-operator.
      Since:
      3.1.1
    • isNegated

      public boolean isNegated()
      Returns:
      true if this filter expression is to be negated when it's appended to the query, false if not
    • setNegated

      public void setNegated(boolean negated)
      Parameters:
      negated - Whether or not the filter expression is to be negated
    • getOwnerEntityType

      public Class<?> getOwnerEntityType()
    • setOwnerEntityType

      public void setOwnerEntityType(Class<?> ownerEntityType)
    • getNestedPropertyName

      public String getNestedPropertyName()
    • setNestedPropertyName

      public void setNestedPropertyName(String nestedPropertyName)
    • getRelationshipType

      public String getRelationshipType()
    • setRelationshipType

      public void setRelationshipType(String relationshipType)
      Specified by:
      setRelationshipType in interface FilterWithRelationship
    • isNested

      public boolean isNested()
    • getNestedPropertyType

      public Class<?> getNestedPropertyType()
    • setNestedPropertyType

      public void setNestedPropertyType(Class<?> nestedPropertyType)
    • getNestedEntityTypeLabel

      public String getNestedEntityTypeLabel()
    • setNestedEntityTypeLabel

      public void setNestedEntityTypeLabel(String nestedEntityTypeLabel)
    • setNestedPath

      public void setNestedPath(Filter.NestedPathSegment... path)
    • getNestedPath

      public List<Filter.NestedPathSegment> getNestedPath()
    • isDeepNested

      public boolean isDeepNested()
    • isNestedRelationshipEntity

      public boolean isNestedRelationshipEntity()
    • setNestedRelationshipEntity

      public void setNestedRelationshipEntity(boolean nestedRelationshipEntity)
    • getPropertyConverter

      public AttributeConverter getPropertyConverter()
    • setPropertyConverter

      public void setPropertyConverter(AttributeConverter propertyConverter)
    • toCypher

      public String toCypher(String nodeIdentifier, boolean addWhereClause)
      Parameters:
      nodeIdentifier - The node identifier
      addWhereClause - The add where clause.
      Returns:
      The filter state as a CYPHER fragment.
    • parameters

      public Map<String,Object> parameters()