Package com.c8db
Interface C8VertexCollection
-
- All Superinterfaces:
C8SerializationAccessor
- All Known Implementing Classes:
C8VertexCollectionImpl
public interface C8VertexCollection extends C8SerializationAccessor
Interface for operations on C8DB vertex collection level.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voiddeleteVertex(String key)Deletes the vertex with the givenkeyfrom the collection.voiddeleteVertex(String key, VertexDeleteOptions options)Deletes the vertex with the givenkeyfrom the collection.voiddrop()Removes a vertex collection from the graph and optionally deletes the collection, if it is not used in any other graph<T> TgetVertex(String key, Class<T> type)Retrieves the vertex document with the givenkeyfrom the collection.<T> TgetVertex(String key, Class<T> type, GraphDocumentReadOptions options)Retrieves the vertex document with the givenkeyfrom the collection.C8Graphgraph()The the handler of the named graph the edge collection is within<T> VertexEntityinsertVertex(T value)Creates a new vertex in the collection<T> VertexEntityinsertVertex(T value, VertexCreateOptions options)Creates a new vertex in the collectionStringname()The name of the edge collection<T> VertexUpdateEntityreplaceVertex(String key, T value)Replaces the vertex with key with the one in the body, provided there is such a vertex and no precondition is violated<T> VertexUpdateEntityreplaceVertex(String key, T value, VertexReplaceOptions options)Replaces the vertex with key with the one in the body, provided there is such a vertex and no precondition is violated<T> VertexUpdateEntityupdateVertex(String key, T value)Partially updates the vertex identified by document-key.<T> VertexUpdateEntityupdateVertex(String key, T value, VertexUpdateOptions options)Partially updates the vertex identified by document-key.-
Methods inherited from interface com.c8db.C8SerializationAccessor
util, util
-
-
-
-
Method Detail
-
graph
C8Graph graph()
The the handler of the named graph the edge collection is within- Returns:
- graph handler
-
name
String name()
The name of the edge collection- Returns:
- collection name
-
drop
void drop() throws C8DBException
Removes a vertex collection from the graph and optionally deletes the collection, if it is not used in any other graph- Throws:
C8DBException- See Also:
- API Documentation
-
insertVertex
<T> VertexEntity insertVertex(T value) throws C8DBException
Creates a new vertex in the collection- Parameters:
value- A representation of a single vertex (POJO, VPackSlice or String for JSON)- Returns:
- information about the vertex
- Throws:
C8DBException- See Also:
- API Documentation
-
insertVertex
<T> VertexEntity insertVertex(T value, VertexCreateOptions options) throws C8DBException
Creates a new vertex in the collection- Parameters:
value- A representation of a single vertex (POJO, VPackSlice or String for JSON)options- Additional options, can be null- Returns:
- information about the vertex
- Throws:
C8DBException- See Also:
- API Documentation
-
getVertex
<T> T getVertex(String key, Class<T> type) throws C8DBException
Retrieves the vertex document with the givenkeyfrom the collection.- Parameters:
key- The key of the vertextype- The type of the vertex-document (POJO class, VPackSlice or String for JSON)- Returns:
- the vertex identified by the key
- Throws:
C8DBException- See Also:
- API Documentation
-
getVertex
<T> T getVertex(String key, Class<T> type, GraphDocumentReadOptions options) throws C8DBException
Retrieves the vertex document with the givenkeyfrom the collection.- Parameters:
key- The key of the vertextype- The type of the vertex-document (POJO class, VPackSlice or String for JSON)options- Additional options, can be null- Returns:
- the vertex identified by the key
- Throws:
C8DBException- See Also:
- API Documentation
-
replaceVertex
<T> VertexUpdateEntity replaceVertex(String key, T value) throws C8DBException
Replaces the vertex with key with the one in the body, provided there is such a vertex and no precondition is violated- Parameters:
key- The key of the vertexvalue- A representation of a single vertex (POJO, VPackSlice or String for JSON)- Returns:
- information about the vertex
- Throws:
C8DBException- See Also:
- API Documentation
-
replaceVertex
<T> VertexUpdateEntity replaceVertex(String key, T value, VertexReplaceOptions options) throws C8DBException
Replaces the vertex with key with the one in the body, provided there is such a vertex and no precondition is violated- Parameters:
key- The key of the vertexvalue- A representation of a single vertex (POJO, VPackSlice or String for JSON)options- Additional options, can be null- Returns:
- information about the vertex
- Throws:
C8DBException- See Also:
- API Documentation
-
updateVertex
<T> VertexUpdateEntity updateVertex(String key, T value) throws C8DBException
Partially updates the vertex identified by document-key. The value must contain a document with the attributes to patch (the patch document). All attributes from the patch document will be added to the existing document if they do not yet exist, and overwritten in the existing document if they do exist there.- Type Parameters:
T- The type of the vertex-document (POJO class, VPackSlice or String for JSON)- Parameters:
key- The key of the vertex- Returns:
- information about the vertex
- Throws:
C8DBException- See Also:
- API Documentation
-
updateVertex
<T> VertexUpdateEntity updateVertex(String key, T value, VertexUpdateOptions options) throws C8DBException
Partially updates the vertex identified by document-key. The value must contain a document with the attributes to patch (the patch document). All attributes from the patch document will be added to the existing document if they do not yet exist, and overwritten in the existing document if they do exist there.- Type Parameters:
T- The type of the vertex-document (POJO class, VPackSlice or String for JSON)- Parameters:
key- The key of the vertexoptions- Additional options, can be null- Returns:
- information about the vertex
- Throws:
C8DBException- See Also:
- API Documentation
-
deleteVertex
void deleteVertex(String key) throws C8DBException
Deletes the vertex with the givenkeyfrom the collection.- Parameters:
key- The key of the vertex- Throws:
C8DBException- See Also:
- API Documentation
-
deleteVertex
void deleteVertex(String key, VertexDeleteOptions options) throws C8DBException
Deletes the vertex with the givenkeyfrom the collection.- Parameters:
key- The key of the vertexoptions- Additional options, can be null- Throws:
C8DBException- See Also:
- API Documentation
-
-