Class NodeQueryStatements<ID extends Serializable>

java.lang.Object
org.neo4j.ogm.session.request.strategy.impl.NodeQueryStatements<ID>
All Implemented Interfaces:
QueryStatements<ID>

public class NodeQueryStatements<ID extends Serializable> extends Object implements QueryStatements<ID>
Author:
Vince Bickers, Luanne Misquitta, Mark Angrish, Nicolas Mervaillie, Michael J. Simons
  • Field Details

    • PROPERTY_SEPARATOR

      public static final String PROPERTY_SEPARATOR
      Some arbitrary characters that hopefully are not used in a @Property. We use them to separate the properties in composite primary keys when passing them through the existing API. This constant is not to be used outside OGM.
      See Also:
  • Constructor Details

    • NodeQueryStatements

      public NodeQueryStatements()
    • NodeQueryStatements

      public NodeQueryStatements(String primaryIndex, LoadClauseBuilder loadClauseBuilder)
  • Method Details

    • joinPrimaryIndexAttributesIfNecessary

      public static String joinPrimaryIndexAttributesIfNecessary(String defaultPrimaryIndex, Object id)
      This method concatenates the keys of an id into one string in case the id is a map, aka a composite key.

      This method is the obverse of splitPrimaryIndexAttributes(String)

      Parameters:
      defaultPrimaryIndex - The default primary index to use (the one applicable when the id is not a composite key)
      id - The actual id
      Returns:
      The concatenated keys or the default, primary index to use (the name of the property annotated with @Id.
    • splitPrimaryIndexAttributes

      public static String splitPrimaryIndexAttributes(String property)
      This joins properties separated by PROPERTY_SEPARATOR into a literal map to be used to match on..
      Parameters:
      property - The property that may contain multiple, separated properties.
      Returns:
      A literal map or a single property reference
    • findOne

      public PagingAndSortingQuery findOne(ID id, int depth)
      Description copied from interface: QueryStatements
      construct a query to fetch a single object with the specified id
      Specified by:
      findOne in interface QueryStatements<ID extends Serializable>
      Parameters:
      id - the id of the object to find
      depth - the depth to traverse for any related objects
      Returns:
      a PagingAndSortingQuery
    • findOneByType

      public PagingAndSortingQuery findOneByType(String label, ID id, int depth)
      Description copied from interface: QueryStatements
      construct a query to fetch a single object with the specified id of a specific type
      Specified by:
      findOneByType in interface QueryStatements<ID extends Serializable>
      Parameters:
      label - the label attached to the object or relationship type
      id - the id of the object to find
      depth - the depth to traverse for any related objects
      Returns:
      a PagingAndSortingQuery
    • findAllByType

      public PagingAndSortingQuery findAllByType(String label, Collection<ID> ids, int depth)
      Description copied from interface: QueryStatements
      construct a query to fetch all objects with the specified ids
      Specified by:
      findAllByType in interface QueryStatements<ID extends Serializable>
      Parameters:
      label - the label attached to the object, or the relationship type
      ids - the ids of the objects to find
      depth - the depth to traverse for any related objects
      Returns:
      a PagingAndSortingQuery
    • findByType

      public PagingAndSortingQuery findByType(String label, int depth)
      Description copied from interface: QueryStatements
      construct queries to fetch all objects with the specified label or relationship type
      Specified by:
      findByType in interface QueryStatements<ID extends Serializable>
      Parameters:
      label - the label attached to the object, or the relationship type
      depth - the depth to traverse for related objects
      Returns:
      a PagingAndSortingQuery
    • findByType

      public PagingAndSortingQuery findByType(String label, Filters parameters, int depth)
      Description copied from interface: QueryStatements
      construct queries to fetch all objects with the specified label that match the specified filters
      Specified by:
      findByType in interface QueryStatements<ID extends Serializable>
      Parameters:
      label - the label value or relationship type to filter on
      parameters - parameters to filter on
      depth - the depth to traverse for related objects
      Returns:
      a PagingAndSortingQuery