Interface QueryConfiguration

All Superinterfaces:
QueryConfiguration
All Known Subinterfaces:
ActiveQueryConfiguration, ConnectedQueryConfiguration
All Known Implementing Classes:
ActiveQueryConfigurationImpl, ConnectedQueryConfigurationImpl, ConnectedQueryQueryConfigurationDelegate, QueryConfigurationImpl

public interface QueryConfiguration extends QueryConfiguration
  • Field Details

  • Method Details

    • getDefault

      static QueryConfiguration getDefault()
      Retrieves the default QueryConfiguration.
      Returns:
      the default QueryConfiguration
    • setDefault

      static void setDefault(QueryConfiguration configuration)
      Sets the default query configuration.
      Parameters:
      configuration - the query configuration to set as default
    • edit

      default QueryConfigurationBuilder edit(DataSource source)
      Returns a builder with the defaults being the settings of this config
      Parameters:
      source - Overrides the current data source
      Returns:
      new builder instance
    • edit

      default QueryConfigurationBuilder edit()
      Returns a builder with the defaults being the settings of this config
      Returns:
      new builder instance
    • builder

      static QueryConfigurationBuilder builder(DataSource source)
      Creates a new QueryConfigurationBuilder instance with the given DataSource.
      Parameters:
      source - the DataSource to use for QueryConfiguration
      Returns:
      a QueryConfigurationBuilder instance
    • forQuery

      Returns a new QueryConfiguration object with the provided query and other configuration settings.
      Specified by:
      forQuery in interface QueryConfiguration
      Parameters:
      context - the query to be associated with the configuration
      Returns:
      the new QueryConfiguration object
    • atomic

      boolean atomic()
      Retrieves the value of the atomic flag.
      Specified by:
      atomic in interface QueryConfiguration
      Returns:
      true if atomic flag is set; false otherwise.
    • throwExceptions

      boolean throwExceptions()
      Retrieves the value of the throwExceptions field.
      Specified by:
      throwExceptions in interface QueryConfiguration
      Returns:
      the value of the throwExceptions field
    • rowMapperRegistry

      RowMapperRegistry rowMapperRegistry()
      Retrieves the RowMapperRegistry object from the QueryConfiguration.
      Specified by:
      rowMapperRegistry in interface QueryConfiguration
      Returns:
      The RowMapperRegistry object from the QueryConfiguration.
    • dataSource

      DataSource dataSource()
      Returns the DataSource object associated with this QueryConfiguration.
      Specified by:
      dataSource in interface QueryConfiguration
      Returns:
      the DataSource object
    • exceptionHandler

      Consumer<SQLException> exceptionHandler()
      Retrieves the exception handler
      Returns:
      exception handler
    • query

      ParsedQuery query(@Language("sql") String sql, Object... format)
      Executes a SQL query with the given SQL statement and format arguments.
      Specified by:
      query in interface QueryConfiguration
      Parameters:
      sql - the SQL statement to be executed
      format - the format arguments to be applied to the SQL statement
      Returns:
      a parsed query ready for execution
    • withSingleTransaction

      ConnectedQueryConfigurationImpl withSingleTransaction()
      Returns a new instance of the ConnectedQueryConfiguration class with the "single transaction" configuration applied. This means that a single transaction will be used for the queries executed using this configuration.
      Specified by:
      withSingleTransaction in interface QueryConfiguration
      Returns:
      A new instance of the ConnectedQueryConfiguration class with the "single transaction" configuration applied.
    • withConnection

      ConnectedQueryConfiguration withConnection(Connection connection)
      Inject a connection into this configuration
      Parameters:
      connection - the connection to inject
      Returns:
      new connected query configuration