Package com.c8db

Interface C8VertexCollection

    • 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
      • 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 given key from the collection.
        Parameters:
        key - The key of the vertex
        type - 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 given key from the collection.
        Parameters:
        key - The key of the vertex
        type - 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 vertex
        value - 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 vertex
        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
      • 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 vertex
        options - Additional options, can be null
        Returns:
        information about the vertex
        Throws:
        C8DBException
        See Also:
        API Documentation