Interface TinkerpopTemplate
- All Superinterfaces:
org.eclipse.jnosql.mapping.graph.GraphTemplate,org.eclipse.jnosql.mapping.semistructured.SemiStructuredTemplate,jakarta.nosql.Template
public interface TinkerpopTemplate
extends org.eclipse.jnosql.mapping.graph.GraphTemplate
GraphTemplate is a helper class that increases productivity when performing common Graph operations.
Includes integrated object mapping between documents and POJOs
Vertex
and Edge.
It represents the common operation between an entity and Graph- See Also:
-
Graph
-
Method Summary
Modifier and TypeMethodDescription<T> voiddelete(T id) Deletes aVertex<T> voiddeleteEdge(Iterable<T> ids) DeletesEdgeinstances<T> voiddeleteEdge(T id) Deletes aEdge<E> Optional<EdgeEntity>edge(E edgeId) Finds anEdgeEntityfrom the Edge Id<O,I> EdgeEntity Either find or create an Edge between this two entities.default <O,I> EdgeEntity Either find or create an Edge between this two entities.<T> Collection<EdgeEntity>edges(T entity, org.apache.tinkerpop.gremlin.structure.Direction direction) returns the edges of from an entity<T> Collection<EdgeEntity>returns the edges of from an entity<T> Collection<EdgeEntity>edges(T entity, org.apache.tinkerpop.gremlin.structure.Direction direction, Supplier<String>... labels) returns the edges of from an entity<K> Collection<EdgeEntity>edgesById(K id, org.apache.tinkerpop.gremlin.structure.Direction direction) returns the edges of from a vertex id<K> Collection<EdgeEntity>returns the edges of from a vertex id<K> Collection<EdgeEntity>edgesById(K id, org.apache.tinkerpop.gremlin.structure.Direction direction, Supplier<String>... labels) returns the edges of from a vertex id<T,K> Optional<T> find(K id) Find an entity givenT.labelandT.id<T> Stream<T>Executes a Gremlin then bring the result as aStream<T> Stream<T>Executes a Gremlin then bring the result as aStreamwith parameterorg.eclipse.jnosql.mapping.PreparedStatementgremlinPrepare(String gremlin) Creates aPreparedStatementfrom the query<T> Optional<T>gremlinSingleResult(String gremlin) Executes a Gremlin query then bring the result as a unique resultorg.apache.tinkerpop.gremlin.structure.TransactionGets the current transactiontraversalEdge(Object... edgeIds) Gets aEdgeTraversalto run a query in the graphtraversalVertex(Object... vertexIds) Gets aVertexTraversalto run a query in the graphMethods inherited from interface org.eclipse.jnosql.mapping.graph.GraphTemplate
delete, edge, edge, edge, findEdgeByIdMethods inherited from interface org.eclipse.jnosql.mapping.semistructured.SemiStructuredTemplate
count, count, count, delete, deleteAll, exists, findAll, prepare, prepare, query, query, select, selectCursor, selectOffSet, singleResult, singleResult, singleResultMethods inherited from interface jakarta.nosql.Template
delete, delete, find, insert, insert, insert, insert, select, update, update
-
Method Details
-
delete
<T> void delete(T id) Deletes aVertex- Type Parameters:
T- the id type- Parameters:
id- the id to be used in the queryT.id- Throws:
NullPointerException- when id is null
-
deleteEdge
<T> void deleteEdge(T id) Deletes aEdge- Specified by:
deleteEdgein interfaceorg.eclipse.jnosql.mapping.graph.GraphTemplate- Type Parameters:
T- the id type- Parameters:
id- the id to be used in the queryT.id- Throws:
NullPointerException- when either label and id are null
-
deleteEdge
DeletesEdgeinstances- Type Parameters:
T- the id type- Parameters:
ids- the ids to be used in the queryT.id- Throws:
NullPointerException- when either label and id are null
-
edge
Either find or create an Edge between this two entities.EdgeentityOUT ---label---> entityIN.
- Type Parameters:
I- the incoming typeO- the outgoing type- Parameters:
incoming- the incoming entitylabel- the Edge labeloutgoing- the outgoing entity- Returns:
- the
EdgeEntityof these two entities - Throws:
NullPointerException- Either when any elements are null or the entity is null
-
edge
Either find or create an Edge between this two entities.EdgeentityOUT ---label---> entityIN.
- Type Parameters:
I- the incoming typeO- the outgoing type- Parameters:
incoming- the incoming entitylabel- the Edge labeloutgoing- the outgoing entity- Returns:
- the
EdgeEntityof these two entities - Throws:
NullPointerException- Either when any elements are null or the entity is null
-
find
Find an entity givenT.labelandT.id- Type Parameters:
T- the entity typeK- the id type- Parameters:
id- the id to be used in the queryT.id- Returns:
- the entity found otherwise
Optional.empty() - Throws:
NullPointerException- when id is null
-
edgesById
<K> Collection<EdgeEntity> edgesById(K id, org.apache.tinkerpop.gremlin.structure.Direction direction, String... labels) returns the edges of from a vertex id- Type Parameters:
K- the K type- Parameters:
id- the iddirection- the directionlabels- the edge labels- Returns:
- the Edges
- Throws:
NullPointerException- where there is any parameter null
-
edgesById
<K> Collection<EdgeEntity> edgesById(K id, org.apache.tinkerpop.gremlin.structure.Direction direction, Supplier<String>... labels) returns the edges of from a vertex id- Type Parameters:
K- the K type- Parameters:
id- the iddirection- the directionlabels- the edge labels- Returns:
- the Edges
- Throws:
NullPointerException- where there is any parameter null
-
edgesById
<K> Collection<EdgeEntity> edgesById(K id, org.apache.tinkerpop.gremlin.structure.Direction direction) returns the edges of from a vertex id- Type Parameters:
K- the K type- Parameters:
id- the iddirection- the direction- Returns:
- the Edges
- Throws:
NullPointerException- where there is any parameter null
-
edges
<T> Collection<EdgeEntity> edges(T entity, org.apache.tinkerpop.gremlin.structure.Direction direction, String... labels) returns the edges of from an entity- Type Parameters:
T- the entity type- Parameters:
entity- the entitydirection- the directionlabels- the edge labels- Returns:
- the Edges
- Throws:
NullPointerException- where there is any parameter null
-
edges
<T> Collection<EdgeEntity> edges(T entity, org.apache.tinkerpop.gremlin.structure.Direction direction, Supplier<String>... labels) returns the edges of from an entity- Type Parameters:
T- the entity type- Parameters:
entity- the entitydirection- the directionlabels- the edge labels- Returns:
- the Edges
- Throws:
NullPointerException- where there is any parameter null
-
edges
<T> Collection<EdgeEntity> edges(T entity, org.apache.tinkerpop.gremlin.structure.Direction direction) returns the edges of from an entity- Type Parameters:
T- the entity type- Parameters:
entity- the entitydirection- the direction- Returns:
- the Edges
- Throws:
NullPointerException- where there is any parameter null
-
edge
Finds anEdgeEntityfrom the Edge Id- Type Parameters:
E- the edge id type- Parameters:
edgeId- the edge id- Returns:
- the
EdgeEntityotherwiseOptional.empty() - Throws:
IllegalStateException- when edgeId is null
-
traversalVertex
Gets aVertexTraversalto run a query in the graph- Parameters:
vertexIds- get ids- Returns:
- a
VertexTraversalinstance - Throws:
IllegalStateException- if any id element is null
-
traversalEdge
Gets aEdgeTraversalto run a query in the graph- Parameters:
edgeIds- get ids- Returns:
- a
VertexTraversalinstance - Throws:
IllegalStateException- if any id element is null
-
transaction
org.apache.tinkerpop.gremlin.structure.Transaction transaction()Gets the current transaction- Returns:
- the current
Transaction
-
gremlin
Executes a Gremlin then bring the result as aStream- Type Parameters:
T- the entity type- Parameters:
gremlin- the query gremlin- Returns:
- the result as
Stream - Throws:
NullPointerException- when the gremlin is null
-
gremlin
Executes a Gremlin then bring the result as aStreamwith parameter- Type Parameters:
T- the entity type- Parameters:
gremlin- the query gremlinparameters- the parameters to be used in the query- Returns:
- the result as
Stream
-
gremlinSingleResult
Executes a Gremlin query then bring the result as a unique result- Type Parameters:
T- the entity type- Parameters:
gremlin- the gremlin query- Returns:
- the result as
List - Throws:
NullPointerException- when the query is null
-
gremlinPrepare
Creates aPreparedStatementfrom the query- Parameters:
gremlin- the gremlin query- Returns:
- a
PreparedStatementinstance - Throws:
NullPointerException- when the query is null
-