Class QueryEngineImpl

  • All Implemented Interfaces:
    QueryEngine

    public abstract class QueryEngineImpl
    extends java.lang.Object
    implements QueryEngine
    The query engine implementation.
    • Constructor Summary

      Constructors 
      Constructor Description
      QueryEngineImpl()  
    • Method Summary

      All Methods Instance Methods Abstract Methods Concrete 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.
      protected abstract ExecutionContext getExecutionContext()
      Get the execution context for a single query execution.
      java.util.Set<java.lang.String> getSupportedQueryLanguages()
      Get the set of supported query languages.
      protected void setQuerySelectionMode​(@NotNull QueryEngineImpl.QuerySelectionMode querySelectionMode)
      Instruct the query engine on how to behave with regards to the SQL2 optimised query if available.
      protected void setTraversalEnabled​(boolean traversalEnabled)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • QueryEngineImpl

        public QueryEngineImpl()
    • Method Detail

      • getExecutionContext

        protected abstract ExecutionContext getExecutionContext()
        Get the execution context for a single query execution.
        Returns:
        the context
      • getSupportedQueryLanguages

        public java.util.Set<java.lang.String> getSupportedQueryLanguages()
        Description copied from interface: QueryEngine
        Get the set of supported query languages.
        Specified by:
        getSupportedQueryLanguages in interface QueryEngine
        Returns:
        the supported query languages
      • getBindVariableNames

        public 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.
        Specified by:
        getBindVariableNames in interface QueryEngine
        Parameters:
        statement - query statement
        language - query language
        mappings - namespace prefix mappings
        Returns:
        the list of bind variable names
        Throws:
        java.text.ParseException
      • executeQuery

        public 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
        Description copied from interface: QueryEngine
        Execute a query and get the result. This is a convenience method: no limit, and offset 0.
        Specified by:
        executeQuery in interface QueryEngine
        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
      • executeQuery

        public 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
        Description copied from interface: QueryEngine
        Execute a query and get the result.
        Specified by:
        executeQuery in interface QueryEngine
        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
      • executeQuery

        public 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
        Description copied from interface: QueryEngine
        Execute a query and get the result.
        Specified by:
        executeQuery in interface QueryEngine
        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
      • setTraversalEnabled

        protected void setTraversalEnabled​(boolean traversalEnabled)
      • setQuerySelectionMode

        protected void setQuerySelectionMode​(@NotNull
                                             @NotNull QueryEngineImpl.QuerySelectionMode querySelectionMode)
        Instruct the query engine on how to behave with regards to the SQL2 optimised query if available.
        Parameters:
        querySelectionMode - cannot be null