- All Known Subinterfaces:
- BindContext,- BindingGetResultSetContext<U>,- BindingGetSQLInputContext<U>,- BindingGetStatementContext<U>,- BindingRegisterContext<U>,- BindingScope,- BindingSetSQLOutputContext<U>,- BindingSetStatementContext<U>,- BindingSQLContext<U>,- CacheContext,- CloseableDSLContext,- Context<C>,- ConverterContext,- DiagnosticsContext,- DSLContext,- ExecuteContext,- ExecuteScope,- GeneratorContext<R,,- X, - T> - Meta,- Migration,- MigrationContext,- ParseContext,- RecordContext,- RenderContext,- ResourceManagingScope,- TransactionContext,- VisitContext
- All Known Implementing Classes:
- DefaultCloseableDSLContext,- DefaultDSLContext
 The scope of the various objects contained in this type (e.g.
 configuration(), settings(), etc.) are implementation
 dependent and will be specified by the concrete subtype of
 Scope. Examples of such scope types are:
 
- BindingScope: A scope used for a single- Bindingoperation.
- Context: Used for a single traversal of a- QueryPartexpression tree to produce a SQL string and / or a list of bind variables.
- ConverterContext: A scope that covers a single- ContextConverter.from(Object, ConverterContext)or- ContextConverter.to(Object, ConverterContext)call.
- DSLContext: The- DSLAPI that creates- Queryinstances in the context of a- Configuration. It shares the wrapped- Configuration's lifecycle.
- ExecuteContext: Used for a single execution of a- Query, containing JDBC resources and other execution relevant objects. Can be accessed by the- ExecuteListenerSPI.
- ExecuteScope: A scope that is used for operations that are- ExecuteContextaware, but may have a more narrow scope, such as e.g.- BindingScope.
- GeneratorContext: A scope that is used for client side computed column expression generation.
- ParseContext: Used for a single parse call. Can be accessed by the- ParseListenerSPI.
- RecordContext: Used a single record operation, such as- UpdatableRecord.store(). Can be accessed by the- RecordListenerSPI.
- TransactionContext: A scope that covers the execution (or nesting) of a single transaction. Can be accessed by the- TransactionListenerSPI.
- VisitContext: A scope that that covers a single traversal of a- QueryPartexpression tree (just like- Context). Can be accessed by the- VisitListenerSPI.
 One of Scope's most interesting features for client code
 implementing any SPI is the data() map, which provides access to a
 Map where client code can register user-defined values for the entire
 lifetime of a scope. For instance, in an ExecuteListener
 implementation that measures time for fetching data, it is perfectly possible
 to store timestamps in that map:
 
 
 class FetchTimeMeasuringListener extends DefaultExecuteListener {
     @Override
     public void fetchStart(ExecuteContext ctx) {
         // Put any arbitrary object in this map:
         ctx.data("org.jooq.example.fetch-start-time", System.nanoTime());
     }
     @Override
     public void fetchEnd(ExecuteContext ctx) {
         // Retrieve that object again in a later step:
         Long startTime = (Long) ctx.data("org.jooq.example.fetch-start-time");
         System.out.println("Time taken: " + (System.nanoTime() - startTime) / 1000 / 1000.0 + " ms");
     }
 }
 
 - Author:
- Lukas Eder
- 
Method SummaryModifier and TypeMethodDescription@NotNull ConfigurationThe configuration of the current scope.@NotNull InstantThe time, according toConfiguration.clock(), when thisScopewas created.data()Get all custom data from thisScope.@Nullable ObjectGet some custom data from thisScope.@Nullable ObjectSet some custom data to thisScope.@NotNull SQLDialectdialect()TheSQLDialectwrapped by this context.@NotNull DSLContextdsl()Wrap theconfiguration()in aDSLContext, providing access to the configuration-contextual DSL to construct executable queries.@NotNull SQLDialectfamily()TheSQLDialect.family()wrapped by this context.@NotNull Settingssettings()The settings wrapped by this context.
- 
Method Details- 
creationTimeThe time, according toConfiguration.clock(), when thisScopewas created.
- 
configurationThe configuration of the current scope.
- 
dslWrap theconfiguration()in aDSLContext, providing access to the configuration-contextual DSL to construct executable queries.
- 
settingsThe settings wrapped by this context.This method is a convenient way of accessing configuration().settings().
- 
dialectTheSQLDialectwrapped by this context.This method is a convenient way of accessing configuration().dialect().
- 
familyTheSQLDialect.family()wrapped by this context.This method is a convenient way of accessing configuration().family().
- 
dataGet all custom data from thisScope.This is custom data that was previously set to the context using data(Object, Object). Use custom data if you want to pass data toQueryPartobjects for a givenScope.- Returns:
- The custom data. This is never null
 
- 
dataGet some custom data from thisScope.This is custom data that was previously set to the context using data(Object, Object). Use custom data if you want to pass data toQueryPartobjects for a givenScope- Parameters:
- key- A key to identify the custom data
- Returns:
- The custom data or nullif no such data is contained in thisScope
 
- 
dataSet some custom data to thisScope.This is custom data that was previously set to the context using data(Object, Object). Use custom data if you want to pass data toQueryPartobjects for a givenScope.- Parameters:
- key- A key to identify the custom data
- value- The custom data
- Returns:
- The previously set custom data or nullif no data was previously set for the given key
 
 
-