com.holonplatform.datastore.jdbc.composer.internal

## Class DefaultSQLExecutionContext

- java.lang.Object
- - com.holonplatform.datastore.jdbc.composer.internal.DefaultSQLExecutionContext

- All Implemented Interfaces:
    com.holonplatform.core.ExpressionResolver.ExpressionResolverProvider, SQLContext, SQLExecutionContext

      public class DefaultSQLExecutionContext
      extends Object
      implements SQLExecutionContext

  Default `SQLExecutionContext`.
  Since:
    5.1.0

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `DefaultSQLExecutionContext(SQLContext sqlContext, Connection connection)` Constructor.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `Optional<Connection>` | `getConnection()` Get the `Connection` used by current operation execution, if available.
    `SQLDialect` | `getDialect()` Get the `SQLDialect` to use.
    `Iterable<com.holonplatform.core.ExpressionResolver>` | `getExpressionResolvers()`
    `void` | `trace(String sql)` Trace given SQL statement.

    - ### Methods inherited from class java.lang.Object

      `equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

    - ### Methods inherited from interface com.holonplatform.datastore.jdbc.composer.SQLExecutionContext

      `create, create`

    - ### Methods inherited from interface com.holonplatform.datastore.jdbc.composer.SQLContext

      `getTypeConverter, getValueDeserializer, getValueSerializer`

- - ### Constructor Detail

    - #### DefaultSQLExecutionContext

          public DefaultSQLExecutionContext(SQLContext sqlContext,
                                            Connection connection)

      Constructor.
      Parameters:
        `sqlContext` - SQL context (not null)
        `connection` - Optional connection

  - ### Method Detail

    - #### getDialect

          public SQLDialect getDialect()

      Description copied from interface: `SQLContext`
      Get the `SQLDialect` to use.
      Specified by:
        `getDialect` in interface `SQLContext`
      Returns:
        The SQL dialect

    - #### trace

          public void trace(String sql)

      Description copied from interface: `SQLContext`
      Trace given SQL statement.

      If tracing is enabled, the SQL statement is logged using the `INFO` level, otherwise it is logged using the `DEBUG` level.

      Specified by:
        `trace` in interface `SQLContext`
      Parameters:
        `sql` - SQL to trace

    - #### getExpressionResolvers

          public Iterable<com.holonplatform.core.ExpressionResolver> getExpressionResolvers()

      Specified by:
        `getExpressionResolvers` in interface `com.holonplatform.core.ExpressionResolver.ExpressionResolverProvider`

    - #### getConnection

          public Optional<Connection> getConnection()

      Description copied from interface: `SQLExecutionContext`
      Get the `Connection` used by current operation execution, if available.
      Specified by:
        `getConnection` in interface `SQLExecutionContext`
      Returns:
        Optional current connection

Copyright © 2019 The Holon Platform. All rights reserved.