Interface Mapper

    • Method Detail

      • scroll

        ScrollResult<Stringscroll​(String query,
                                    int batchSize,
                                    int keepAliveSeconds)
        Executes the given query and returns the first batch of results containing id of documents, next batch must be requested within the keepAliveSeconds delay.
        Since:
        8.4
      • scroll

        ScrollResult<Stringscroll​(String query,
                                    QueryFilter queryFilter,
                                    int batchSize,
                                    int keepAliveSeconds)
        Executes the given query and returns the first batch of results containing id of documents, next batch must be requested within the keepAliveSeconds delay.
        Since:
        10.3
      • getIdentification

        Mapper.Identification getIdentification()
        Returns the repository id and mapper id assigned.

        This is used in remote stateless mode to be able to identify to which mapper an incoming connection is targeted, and from which repository instance.

        Returns:
        the repository and mapper identification
      • getRootId

        Serializable getRootId​(String repositoryId)
        Gets the root id for a given repository, if registered.
        Parameters:
        repositoryId - the repository id
        Returns:
        the root id, or null if not found
      • setRootId

        void setRootId​(Serializable repositoryId,
                       Serializable id)
        Records the newly generated root id for a given repository.
        Parameters:
        repositoryId - the repository id, usually 0
        id - the root id
      • query

        PartialList<Serializablequery​(String query,
                                        String queryType,
                                        QueryFilter queryFilter,
                                        boolean countTotal)
        Makes a NXQL query to the database.
        Parameters:
        query - the query
        queryType - the query type
        queryFilter - the query filter
        countTotal - if true, count the total size without limit/offset
        Returns:
        the list of matching document ids
      • query

        PartialList<Serializablequery​(String query,
                                        String queryType,
                                        QueryFilter queryFilter,
                                        long countUpTo)
        Makes a NXQL query to the database.
        Parameters:
        query - the query
        queryType - the query type
        queryFilter - the query filter
        countUpTo - if -1, count the total size without offset/limit.
        If 0, don't count the total size.
        If n, count the total number if there are less than n documents otherwise set the size to -1.
        Returns:
        the list of matching document ids
        Since:
        5.6
      • queryAndFetch

        IterableQueryResult queryAndFetch​(String query,
                                          String queryType,
                                          QueryFilter queryFilter,
                                          boolean distinctDocuments,
                                          Object... params)
        Makes a query to the database and returns an iterable (which must be closed when done).
        Parameters:
        query - the query
        queryType - the query type
        queryFilter - the query filter
        distinctDocuments - if true then a maximum of one row per document will be returned
        params - optional query-type-dependent parameters
        Returns:
        an iterable, which must be closed when done
      • queryProjection

        PartialList<Map<String,​Serializable>> queryProjection​(String query,
                                                                    String queryType,
                                                                    QueryFilter queryFilter,
                                                                    boolean distinctDocuments,
                                                                    long countUpTo,
                                                                    Object... params)
        Makes a query to the database.
        Parameters:
        query - the query
        queryType - the query type
        queryFilter - the query filter
        distinctDocuments - if true then a maximum of one row per document will be returned
        countUpTo - if -1, also count the total size without offset/limit.
        If 0, don't count the total size.
        If n, count the total number if there are less than n documents otherwise set the size to -1.
        params - optional query-type-dependent parameters
        Returns:
        a projection
        Since:
        7.10-HF-25, 8.10-HF06, 9.2
      • markReferencedBinaries

        void markReferencedBinaries()
        Marks the binaries in use by passing them to the binary manager(s)'s GC mark() method.
      • cleanupDeletedRows

        int cleanupDeletedRows​(int max,
                               Calendar beforeTime)
        Cleans up (hard-delete) any rows that have been soft-deleted in the database.
        Parameters:
        max - the maximum number of rows to delete at a time
        beforeTime - the maximum deletion time of the rows to delete
        Returns:
        the number of rows deleted