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 Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionNodeQueryStatements
(String primaryIndex, LoadClauseBuilder loadClauseBuilder) -
Method Summary
Modifier and TypeMethodDescriptionfindAllByType
(String label, Collection<ID> ids, int depth) construct a query to fetch all objects with the specified idsfindByType
(String label, int depth) construct queries to fetch all objects with the specified label or relationship typefindByType
(String label, Filters parameters, int depth) construct queries to fetch all objects with the specified label that match the specified filtersconstruct a query to fetch a single object with the specified idfindOneByType
(String label, ID id, int depth) construct a query to fetch a single object with the specified id of a specific typestatic 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.static String
splitPrimaryIndexAttributes
(String property) This joins properties separated byPROPERTY_SEPARATOR
into a literal map to be used to match on..
-
Field Details
-
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
-
-
Method Details
-
joinPrimaryIndexAttributesIfNecessary
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
This joins properties separated byPROPERTY_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
Description copied from interface:QueryStatements
construct a query to fetch a single object with the specified id- Specified by:
findOne
in interfaceQueryStatements<ID extends Serializable>
- Parameters:
id
- the id of the object to finddepth
- the depth to traverse for any related objects- Returns:
- a
PagingAndSortingQuery
-
findOneByType
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 interfaceQueryStatements<ID extends Serializable>
- Parameters:
label
- the label attached to the object or relationship typeid
- the id of the object to finddepth
- the depth to traverse for any related objects- Returns:
- a
PagingAndSortingQuery
-
findAllByType
Description copied from interface:QueryStatements
construct a query to fetch all objects with the specified ids- Specified by:
findAllByType
in interfaceQueryStatements<ID extends Serializable>
- Parameters:
label
- the label attached to the object, or the relationship typeids
- the ids of the objects to finddepth
- the depth to traverse for any related objects- Returns:
- a
PagingAndSortingQuery
-
findByType
Description copied from interface:QueryStatements
construct queries to fetch all objects with the specified label or relationship type- Specified by:
findByType
in interfaceQueryStatements<ID extends Serializable>
- Parameters:
label
- the label attached to the object, or the relationship typedepth
- the depth to traverse for related objects- Returns:
- a
PagingAndSortingQuery
-
findByType
Description copied from interface:QueryStatements
construct queries to fetch all objects with the specified label that match the specified filters- Specified by:
findByType
in interfaceQueryStatements<ID extends Serializable>
- Parameters:
label
- the label value or relationship type to filter onparameters
- parameters to filter ondepth
- the depth to traverse for related objects- Returns:
- a
PagingAndSortingQuery
-