Module org.jooq
Package org.jooq.impl

Class DefaultCloseableDSLContext

java.lang.Object
org.jooq.impl.DefaultDSLContext
org.jooq.impl.DefaultCloseableDSLContext
All Implemented Interfaces:
Serializable, AutoCloseable, CloseableDSLContext, DSLContext, Scope

public class DefaultCloseableDSLContext extends DefaultDSLContext implements CloseableDSLContext
An extension of DefaultDSLContext that implements also the CloseableDSLContext contract.
See Also:
  • Constructor Details

    • DefaultCloseableDSLContext

      public DefaultCloseableDSLContext(ConnectionProvider connectionProvider, SQLDialect dialect, Settings settings)
    • DefaultCloseableDSLContext

      public DefaultCloseableDSLContext(ConnectionProvider connectionProvider, SQLDialect dialect)
    • DefaultCloseableDSLContext

      public DefaultCloseableDSLContext(io.r2dbc.spi.ConnectionFactory connectionFactory, SQLDialect dialect, Settings settings)
    • DefaultCloseableDSLContext

      public DefaultCloseableDSLContext(io.r2dbc.spi.ConnectionFactory connectionFactory, SQLDialect dialect)
  • Method Details

    • close

      public void close()
      Description copied from interface: CloseableDSLContext
      Close the underlying resources, if any resources have been allocated when constructing this DSLContext.

      Some DSLContext constructors, such as DSL.using(String), DSL.using(String, Properties), or DSL.using(String, String, String) allocate a Connection resource, which is inaccessible to the outside of the DSLContext implementation. Proper resource management must thus be done via this CloseableDSLContext.close() method.

      Specified by:
      close in interface AutoCloseable
      Specified by:
      close in interface CloseableDSLContext
    • configuration

      public final Configuration configuration()
      Description copied from interface: Scope
      The configuration of the current scope.
      Specified by:
      configuration in interface Scope
    • dsl

      public final DSLContext dsl()
      Description copied from interface: Scope
      Wrap the Scope.configuration() in a DSLContext, providing access to the configuration-contextual DSL to construct executable queries.
      Specified by:
      dsl in interface Scope
    • settings

      public final Settings settings()
      Description copied from interface: Scope
      The settings wrapped by this context.

      This method is a convenient way of accessing configuration().settings().

      Specified by:
      settings in interface Scope
    • dialect

      public final SQLDialect dialect()
      Description copied from interface: Scope
      The SQLDialect wrapped by this context.

      This method is a convenient way of accessing configuration().dialect().

      Specified by:
      dialect in interface Scope
    • family

      public final SQLDialect family()
      Description copied from interface: Scope
      The SQLDialect.family() wrapped by this context.

      This method is a convenient way of accessing configuration().family().

      Specified by:
      family in interface Scope
    • data

      public final Map<Object,Object> data()
      Description copied from interface: Scope
      Get all custom data from this Scope.

      This is custom data that was previously set to the context using Scope.data(Object, Object). Use custom data if you want to pass data to QueryPart objects for a given Scope.

      Specified by:
      data in interface Scope
      Returns:
      The custom data. This is never null
    • data

      public final Object data(Object key)
      Description copied from interface: Scope
      Get some custom data from this Scope.

      This is custom data that was previously set to the context using Scope.data(Object, Object). Use custom data if you want to pass data to QueryPart objects for a given Scope

      Specified by:
      data in interface Scope
      Parameters:
      key - A key to identify the custom data
      Returns:
      The custom data or null if no such data is contained in this Scope
    • data

      public final Object data(Object key, Object value)
      Description copied from interface: Scope
      Set some custom data to this Scope.

      This is custom data that was previously set to the context using Scope.data(Object, Object). Use custom data if you want to pass data to QueryPart objects for a given Scope.

      Specified by:
      data in interface Scope
      Parameters:
      key - A key to identify the custom data
      value - The custom data
      Returns:
      The previously set custom data or null if no data was previously set for the given key