Interface QueryEngine


  • @ProviderType
    public interface QueryEngine
    The query engine allows to parse and execute queries.

    What query languages are supported depends on the registered query parsers.

    • Field Summary

      Fields 
      Modifier and Type Field Description
      static java.lang.String INTERNAL_SQL2_QUERY
      The suffix for internal SQL-2 statements.
      static java.util.Map<java.lang.String,​PropertyValue> NO_BINDINGS
      Empty set of variables bindings.
      static java.util.Map<java.lang.String,​java.lang.String> NO_MAPPINGS
      Empty set of namespace prefix mappings.
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      Result executeQuery​(java.lang.String statement, java.lang.String language, long limit, long offset, java.util.Map<java.lang.String,​? extends PropertyValue> bindings, java.util.Map<java.lang.String,​java.lang.String> mappings)
      Execute a query and get the result.
      Result executeQuery​(java.lang.String statement, java.lang.String language, java.util.Map<java.lang.String,​? extends PropertyValue> bindings, java.util.Map<java.lang.String,​java.lang.String> mappings)
      Execute a query and get the result.
      Result executeQuery​(java.lang.String statement, java.lang.String language, java.util.Optional<java.lang.Long> limit, java.util.Optional<java.lang.Long> offset, java.util.Map<java.lang.String,​? extends PropertyValue> bindings, java.util.Map<java.lang.String,​java.lang.String> mappings)
      Execute a query and get the result.
      java.util.List<java.lang.String> getBindVariableNames​(java.lang.String statement, java.lang.String language, java.util.Map<java.lang.String,​java.lang.String> mappings)
      Parse the query (check if it's valid) and get the list of bind variable names.
      java.util.Set<java.lang.String> getSupportedQueryLanguages()
      Get the set of supported query languages.
    • Method Detail

      • getSupportedQueryLanguages

        java.util.Set<java.lang.String> getSupportedQueryLanguages()
        Get the set of supported query languages.
        Returns:
        the supported query languages
      • getBindVariableNames

        java.util.List<java.lang.String> getBindVariableNames​(java.lang.String statement,
                                                              java.lang.String language,
                                                              java.util.Map<java.lang.String,​java.lang.String> mappings)
                                                       throws java.text.ParseException
        Parse the query (check if it's valid) and get the list of bind variable names.
        Parameters:
        statement - query statement
        language - query language
        mappings - namespace prefix mappings
        Returns:
        the list of bind variable names
        Throws:
        java.text.ParseException
      • executeQuery

        Result executeQuery​(java.lang.String statement,
                            java.lang.String language,
                            long limit,
                            long offset,
                            java.util.Map<java.lang.String,​? extends PropertyValue> bindings,
                            java.util.Map<java.lang.String,​java.lang.String> mappings)
                     throws java.text.ParseException
        Execute a query and get the result.
        Parameters:
        statement - the query statement
        language - the language
        limit - the maximum result set size (may not be negative)
        offset - the number of rows to skip (may not be negative)
        bindings - the bind variable value bindings
        mappings - namespace prefix mappings
        Returns:
        the result
        Throws:
        java.text.ParseException - if the statement could not be parsed
        java.lang.IllegalArgumentException - if there was an error executing the query
      • executeQuery

        Result executeQuery​(java.lang.String statement,
                            java.lang.String language,
                            java.util.Optional<java.lang.Long> limit,
                            java.util.Optional<java.lang.Long> offset,
                            java.util.Map<java.lang.String,​? extends PropertyValue> bindings,
                            java.util.Map<java.lang.String,​java.lang.String> mappings)
                     throws java.text.ParseException
        Execute a query and get the result.
        Parameters:
        statement - the query statement
        language - the language
        limit - the maximum result set size (may not be negative but may be empty)
        offset - the number of rows to skip (may not be negative but may be empty)
        bindings - the bind variable value bindings
        mappings - namespace prefix mappings
        Returns:
        the result
        Throws:
        java.text.ParseException - if the statement could not be parsed
        java.lang.IllegalArgumentException - if there was an error executing the query
      • executeQuery

        Result executeQuery​(java.lang.String statement,
                            java.lang.String language,
                            java.util.Map<java.lang.String,​? extends PropertyValue> bindings,
                            java.util.Map<java.lang.String,​java.lang.String> mappings)
                     throws java.text.ParseException
        Execute a query and get the result. This is a convenience method: no limit, and offset 0.
        Parameters:
        statement - the query statement
        language - the language
        bindings - the bind variable value bindings
        mappings - namespace prefix mappings
        Returns:
        the result
        Throws:
        java.text.ParseException - if the statement could not be parsed
        java.lang.IllegalArgumentException - if there was an error executing the query