Package com.c8db

Interface C8EdgeCollection

    • 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
      • insertEdge

        <T> EdgeEntity insertEdge​(T value)
                           throws C8DBException
        Creates a new edge in the collection
        Parameters:
        value - A representation of a single edge (POJO, VPackSlice or String for JSON)
        Returns:
        information about the edge
        Throws:
        C8DBException
      • insertEdge

        <T> EdgeEntity insertEdge​(T value,
                                  EdgeCreateOptions options)
                           throws C8DBException
        Creates a new edge in the collection
        Parameters:
        value - A representation of a single edge (POJO, VPackSlice or String for JSON)
        options - Additional options, can be null
        Returns:
        information about the edge
        Throws:
        C8DBException
        See Also:
        API Documentation
      • getEdge

        <T> T getEdge​(String key,
                      Class<T> type)
               throws C8DBException
        Fetches an existing edge
        Parameters:
        key - The key of the edge
        type - The type of the edge-document (POJO class, VPackSlice or String for JSON)
        Returns:
        the edge identified by the key
        Throws:
        C8DBException
        See Also:
        API Documentation
      • replaceEdge

        <T> EdgeUpdateEntity replaceEdge​(String key,
                                         T value)
                                  throws C8DBException
        Replaces the edge with key with the one in the body, provided there is such a edge and no precondition is violated
        Type Parameters:
        T - The type of the edge-document (POJO class, VPackSlice or String for JSON)
        Parameters:
        key - The key of the edge
        Returns:
        information about the edge
        Throws:
        C8DBException
        See Also:
        API Documentation
      • replaceEdge

        <T> EdgeUpdateEntity replaceEdge​(String key,
                                         T value,
                                         EdgeReplaceOptions options)
                                  throws C8DBException
        Replaces the edge with key with the one in the body, provided there is such a edge and no precondition is violated
        Type Parameters:
        T - The type of the edge-document (POJO class, VPackSlice or String for JSON)
        Parameters:
        key - The key of the edge
        options - Additional options, can be null
        Returns:
        information about the edge
        Throws:
        C8DBException
        See Also:
        API Documentation
      • updateEdge

        <T> EdgeUpdateEntity updateEdge​(String key,
                                        T value)
                                 throws C8DBException
        Partially updates the edge 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 edge-document (POJO class, VPackSlice or String for JSON)
        Parameters:
        key - The key of the edge
        Returns:
        information about the edge
        Throws:
        C8DBException
        See Also:
        API Documentation
      • updateEdge

        <T> EdgeUpdateEntity updateEdge​(String key,
                                        T value,
                                        EdgeUpdateOptions options)
                                 throws C8DBException
        Partially updates the edge 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 edge-document (POJO class, VPackSlice or String for JSON)
        Parameters:
        key - The key of the edge
        options - Additional options, can be null
        Returns:
        information about the edge
        Throws:
        C8DBException
        See Also:
        API Documentation