Class QueryExecutor

java.lang.Object
scriptella.core.QueryExecutor
All Implemented Interfaces:
ExecutableElement

public final class QueryExecutor extends Object
<query> element executor.
Version:
1.0
Author:
Fyodor Kupolov
  • Field Details

    • log

      protected final Logger log
    • debug

      protected final boolean debug
  • Method Details

    • execute

      protected void execute(Connection connection, Resource resource, DynamicContext ctx)
      Executes a script or a query resource using the specified connection.
      Parameters:
      connection - connection to use for element execution.
      resource - query/script content to execute.
      ctx - dynamic context to use for variables, etc.
    • prepare

      public static ExecutableElement prepare(QueryEl queryEl)
    • getElement

      public QueryEl getElement()
      Returns scripting element specified in constructor
      Returns:
      scripting element
    • execute

      public final void execute(DynamicContext ctx)
      Description copied from interface: ExecutableElement
      Executes the element.

      Note: the context may be decorated by DynamicContextDecorator.

      Specified by:
      execute in interface ExecutableElement
      Parameters:
      ctx - context to use.
    • getContent

      public Resource getContent(DialectIdentifier dialectIdentifier)
      Returns content satisfying dialect information.

      This method caches contents based on dialects. For now we assume dialectIdentifier is constant for element.

      Parameters:
      dialectIdentifier - dialect identifier.
      Returns:
      content for dialect. Not null.
    • getLocation

      public Location getLocation()
      Returns:
      element location.
    • prepareContent

      protected ContentEl prepareContent(ContentEl content)
      Prepares the content for later execution.

      If content is dynamic, i.e. contains includes with bind variables, the properties substitutor is specified, otherwise no properties .

      Parameters:
      content - content to traverse.
      Returns:
      the same content object for convenience only.