Module org.jooq
Package org.jooq.impl

Class DefaultConfiguration

    • Constructor Detail

      • DefaultConfiguration

        public DefaultConfiguration()
        Create a new "empty" configuration object.

        This can be used as is, as a "dummy" configuration object, or as a base implementation for creating more sophisticated "derived" configurations through the various derive() or set() methods.

    • Method Detail

      • derive

        public final Configuration derive()
        Description copied from interface: Configuration
        Create a derived configuration from this one, without changing any properties.
        Specified by:
        derive in interface Configuration
        Returns:
        The derived configuration.
      • derive

        public final Configuration derive​(Connection newConnection)
        Description copied from interface: Configuration
        Create a derived configuration from this one, with a new connection wrapped in a DefaultConnectionProvider.
        Specified by:
        derive in interface Configuration
        Parameters:
        newConnection - The new connection to be contained in the derived configuration.
        Returns:
        The derived configuration.
      • derive

        public final Configuration derive​(DataSource newDataSource)
        Description copied from interface: Configuration
        Create a derived configuration from this one, with a new data source wrapped in a DataSourceConnectionProvider.
        Specified by:
        derive in interface Configuration
        Parameters:
        newDataSource - The new data source to be contained in the derived configuration.
        Returns:
        The derived configuration.
      • derive

        public final Configuration derive​(ConnectionProvider newConnectionProvider)
        Description copied from interface: Configuration
        Create a derived configuration from this one, with a new connection provider.
        Specified by:
        derive in interface Configuration
        Parameters:
        newConnectionProvider - The new connection provider to be contained in the derived configuration.
        Returns:
        The derived configuration.
      • derive

        public final Configuration derive​(MetaProvider newMetaProvider)
        Description copied from interface: Configuration
        Create a derived configuration from this one, with a new meta provider.
        Specified by:
        derive in interface Configuration
        Parameters:
        newMetaProvider - The new meta provider to be contained in the derived configuration.
        Returns:
        The derived configuration.
      • derive

        public final Configuration derive​(Executor newExecutor)
        Description copied from interface: Configuration
        Create a derived configuration from this one, with a new executor.

        This will wrap the argument Executor in a DefaultExecutorProvider for convenience.

        Specified by:
        derive in interface Configuration
        Parameters:
        newExecutor - The new executor to be contained in the derived configuration.
        Returns:
        The derived configuration.
      • derive

        public final Configuration derive​(ExecutorProvider newExecutorProvider)
        Description copied from interface: Configuration
        Create a derived configuration from this one, with a new executor provider.
        Specified by:
        derive in interface Configuration
        Parameters:
        newExecutorProvider - The new executor provider to be contained in the derived configuration.
        Returns:
        The derived configuration.
      • derive

        public final Configuration derive​(TransactionProvider newTransactionProvider)
        Description copied from interface: Configuration
        Create a derived configuration from this one, with a new transaction provider.
        Specified by:
        derive in interface Configuration
        Parameters:
        newTransactionProvider - The new transaction provider to be contained in the derived configuration.
        Returns:
        The derived configuration.
      • derive

        public final Configuration derive​(RecordMapper<?,​?> newRecordMapper)
        Description copied from interface: Configuration
        Create a derived configuration from this one, with a new record mapper.

        This will wrap the argument RecordMapper in a DefaultRecordMapperProvider for convenience.

        Specified by:
        derive in interface Configuration
        Parameters:
        newRecordMapper - The new record mapper to be contained in the derived configuration.
        Returns:
        The derived configuration.
      • derive

        public final Configuration derive​(RecordMapperProvider newRecordMapperProvider)
        Description copied from interface: Configuration
        Create a derived configuration from this one, with a new record mapper provider.
        Specified by:
        derive in interface Configuration
        Parameters:
        newRecordMapperProvider - The new record mapper provider to be contained in the derived configuration.
        Returns:
        The derived configuration.
      • derive

        public final Configuration derive​(RecordUnmapperProvider newRecordUnmapperProvider)
        Description copied from interface: Configuration
        Create a derived configuration from this one, with a new record unmapper provider.
        Specified by:
        derive in interface Configuration
        Parameters:
        newRecordUnmapperProvider - The new record unmapper provider to be contained in the derived configuration.
        Returns:
        The derived configuration.
      • derive

        public final Configuration derive​(RecordListenerProvider... newRecordListenerProviders)
        Description copied from interface: Configuration
        Create a derived configuration from this one, with new record listener providers.
        Specified by:
        derive in interface Configuration
        Parameters:
        newRecordListenerProviders - The new record listener providers to be contained in the derived configuration.
        Returns:
        The derived configuration.
      • derive

        public final Configuration derive​(ExecuteListenerProvider... newExecuteListenerProviders)
        Description copied from interface: Configuration
        Create a derived configuration from this one, with new execute listener providers.
        Specified by:
        derive in interface Configuration
        Parameters:
        newExecuteListenerProviders - The new execute listener providers to be contained in the derived configuration.
        Returns:
        The derived configuration.
      • derive

        public final Configuration derive​(VisitListenerProvider... newVisitListenerProviders)
        Description copied from interface: Configuration
        Create a derived configuration from this one, with new visit listener providers.
        Specified by:
        derive in interface Configuration
        Parameters:
        newVisitListenerProviders - The new visit listener providers to be contained in the derived configuration.
        Returns:
        The derived configuration.
      • derive

        public final Configuration derive​(TransactionListenerProvider... newTransactionListenerProviders)
        Description copied from interface: Configuration
        Create a derived configuration from this one, with new transaction listener providers.
        Specified by:
        derive in interface Configuration
        Parameters:
        newTransactionListenerProviders - The new transaction listener providers to be contained in the derived configuration.
        Returns:
        The derived configuration.
      • derive

        public final Configuration derive​(DiagnosticsListener... newDiagnosticsListeners)
        Description copied from interface: Configuration
        Create a derived configuration from this one, with new diagnostics listeners.
        Specified by:
        derive in interface Configuration
        Parameters:
        newDiagnosticsListeners - The new diagnostics listeners to be contained in the derived configuration.
        Returns:
        The derived configuration.
      • derive

        public final Configuration derive​(DiagnosticsListenerProvider... newDiagnosticsListenerProviders)
        Description copied from interface: Configuration
        Create a derived configuration from this one, with new diagnostics listener providers.
        Specified by:
        derive in interface Configuration
        Parameters:
        newDiagnosticsListenerProviders - The new diagnostics listener providers to be contained in the derived configuration.
        Returns:
        The derived configuration.
      • derive

        public final Configuration derive​(Unwrapper newUnwrapper)
        Description copied from interface: Configuration
        Create a derived configuration from this one, with a new unwrapper.
        Specified by:
        derive in interface Configuration
        Parameters:
        newUnwrapper - The new unwrapper to be contained in the derived configuration.
        Returns:
        The derived configuration.
      • derive

        public final Configuration derive​(UnwrapperProvider newUnwrapperProvider)
        Description copied from interface: Configuration
        Create a derived configuration from this one, with a new unwrapper provider.
        Specified by:
        derive in interface Configuration
        Parameters:
        newUnwrapperProvider - The new unwrapper provider to be contained in the derived configuration.
        Returns:
        The derived configuration.
      • derive

        public final Configuration derive​(ConverterProvider newConverterProvider)
        Description copied from interface: Configuration
        Create a derived configuration from this one, with new converter provider.
        Specified by:
        derive in interface Configuration
        Parameters:
        newConverterProvider - The new converter provider to be contained in the derived configuration.
        Returns:
        The derived configuration.
      • derive

        public final Configuration derive​(Clock newClock)
        Description copied from interface: Configuration
        Create a derived configuration from this one, with a new Clock.
        Specified by:
        derive in interface Configuration
        Parameters:
        newClock - The new clock to be contained in the derived configuration.
        Returns:
        The derived configuration.
      • derive

        public final Configuration derive​(SQLDialect newDialect)
        Description copied from interface: Configuration
        Create a derived configuration from this one, with a new dialect.
        Specified by:
        derive in interface Configuration
        Parameters:
        newDialect - The new dialect to be contained in the derived configuration.
        Returns:
        The derived configuration.
      • derive

        public final Configuration derive​(Settings newSettings)
        Description copied from interface: Configuration
        Create a derived configuration from this one, with new settings.
        Specified by:
        derive in interface Configuration
        Parameters:
        newSettings - The new settings to be contained in the derived configuration.
        Returns:
        The derived configuration.
      • set

        public final Configuration set​(Connection newConnection)
        Description copied from interface: Configuration
        Change this configuration to hold a new connection wrapped in a DefaultConnectionProvider.

        This method is not thread-safe and should not be used in globally available Configuration objects.

        Specified by:
        set in interface Configuration
        Parameters:
        newConnection - The new connection to be contained in the changed configuration.
        Returns:
        The changed configuration.
      • set

        public final Configuration set​(DataSource newDataSource)
        Description copied from interface: Configuration
        Change this configuration to hold a new data source wrapped in a DataSourceConnectionProvider.

        This method is not thread-safe and should not be used in globally available Configuration objects.

        Specified by:
        set in interface Configuration
        Parameters:
        newDataSource - The new data source to be contained in the changed configuration.
        Returns:
        The changed configuration.
      • set

        public final Configuration set​(ConnectionProvider newConnectionProvider)
        Description copied from interface: Configuration
        Change this configuration to hold a new connection provider.

        This method is not thread-safe and should not be used in globally available Configuration objects.

        Specified by:
        set in interface Configuration
        Parameters:
        newConnectionProvider - The new connection provider to be contained in the changed configuration.
        Returns:
        The changed configuration.
      • set

        public final Configuration set​(MetaProvider newMetaProvider)
        Description copied from interface: Configuration
        Change this configuration to hold a new meta provider.

        This method is not thread-safe and should not be used in globally available Configuration objects.

        Specified by:
        set in interface Configuration
        Parameters:
        newMetaProvider - The new meta provider to be contained in the changed configuration.
        Returns:
        The changed configuration.
      • set

        public final Configuration set​(Executor newExecutor)
        Description copied from interface: Configuration
        Change this configuration to hold a new executor.

        This will wrap the argument Executor in a DefaultExecutorProvider for convenience.

        This method is not thread-safe and should not be used in globally available Configuration objects.

        Specified by:
        set in interface Configuration
        Parameters:
        newExecutor - The new executor to be contained in the changed configuration.
        Returns:
        The changed configuration.
      • set

        public final Configuration set​(ExecutorProvider newExecutorProvider)
        Description copied from interface: Configuration
        Change this configuration to hold a new executor provider.

        This method is not thread-safe and should not be used in globally available Configuration objects.

        Specified by:
        set in interface Configuration
        Parameters:
        newExecutorProvider - The new executor provider to be contained in the changed configuration.
        Returns:
        The changed configuration.
      • set

        public final Configuration set​(TransactionProvider newTransactionProvider)
        Description copied from interface: Configuration
        Change this configuration to hold a new transaction provider.

        This method is not thread-safe and should not be used in globally available Configuration objects.

        Specified by:
        set in interface Configuration
        Parameters:
        newTransactionProvider - The new transaction provider to be contained in the changed configuration.
        Returns:
        The changed configuration.
      • set

        public final Configuration set​(RecordMapper<?,​?> newRecordMapper)
        Description copied from interface: Configuration
        Change this configuration to hold a new record mapper.

        This will wrap the argument RecordMapper in a DefaultRecordMapperProvider for convenience.

        This method is not thread-safe and should not be used in globally available Configuration objects.

        Specified by:
        set in interface Configuration
        Parameters:
        newRecordMapper - The new record mapper to be contained in the changed configuration.
        Returns:
        The changed configuration.
      • set

        public final Configuration set​(RecordMapperProvider newRecordMapperProvider)
        Description copied from interface: Configuration
        Change this configuration to hold a new record mapper provider.

        This method is not thread-safe and should not be used in globally available Configuration objects.

        Specified by:
        set in interface Configuration
        Parameters:
        newRecordMapperProvider - The new record mapper provider to be contained in the changed configuration.
        Returns:
        The changed configuration.
      • set

        public final Configuration set​(RecordUnmapper<?,​?> newRecordUnmapper)
        Description copied from interface: Configuration
        Change this configuration to hold a new record unmapper.

        This will wrap the argument RecordUnmapper in a DefaultRecordUnmapperProvider for convenience.

        This method is not thread-safe and should not be used in globally available Configuration objects.

        Specified by:
        set in interface Configuration
        Parameters:
        newRecordUnmapper - The new record unmapper to be contained in the changed configuration.
        Returns:
        The changed configuration.
      • set

        public final Configuration set​(RecordUnmapperProvider newRecordUnmapperProvider)
        Description copied from interface: Configuration
        Change this configuration to hold a new record unmapper provider.

        This method is not thread-safe and should not be used in globally available Configuration objects.

        Specified by:
        set in interface Configuration
        Parameters:
        newRecordUnmapperProvider - The new record unmapper provider to be contained in the changed configuration.
        Returns:
        The changed configuration.
      • set

        public final Configuration set​(RecordListener... newRecordListeners)
        Description copied from interface: Configuration
        Change this configuration to hold a new record listeners.

        This will wrap the argument RecordListener in a DefaultRecordListenerProvider for convenience.

        This method is not thread-safe and should not be used in globally available Configuration objects.

        Specified by:
        set in interface Configuration
        Parameters:
        newRecordListeners - The new record listener to be contained in the changed configuration.
        Returns:
        The changed configuration.
      • set

        public final Configuration set​(RecordListenerProvider... newRecordListenerProviders)
        Description copied from interface: Configuration
        Change this configuration to hold a new record listener providers.

        This method is not thread-safe and should not be used in globally available Configuration objects.

        Specified by:
        set in interface Configuration
        Parameters:
        newRecordListenerProviders - The new record listener providers to be contained in the changed configuration.
        Returns:
        The changed configuration.
      • set

        public final Configuration set​(ExecuteListener... newExecuteListeners)
        Description copied from interface: Configuration
        Change this configuration to hold a new execute listeners.

        This will wrap the argument ExecuteListener in a DefaultExecuteListenerProvider for convenience.

        This method is not thread-safe and should not be used in globally available Configuration objects.

        Specified by:
        set in interface Configuration
        Parameters:
        newExecuteListeners - The new execute listeners to be contained in the changed configuration.
        Returns:
        The changed configuration.
      • set

        public final Configuration set​(ExecuteListenerProvider... newExecuteListenerProviders)
        Description copied from interface: Configuration
        Change this configuration to hold a new execute listener providers.

        This method is not thread-safe and should not be used in globally available Configuration objects.

        Specified by:
        set in interface Configuration
        Parameters:
        newExecuteListenerProviders - The new execute listener providers to be contained in the changed configuration.
        Returns:
        The changed configuration.
      • set

        public final Configuration set​(VisitListener... newVisitListeners)
        Description copied from interface: Configuration
        Change this configuration to hold a new visit listeners.

        This will wrap the argument VisitListener in a DefaultVisitListenerProvider for convenience.

        This method is not thread-safe and should not be used in globally available Configuration objects.

        Specified by:
        set in interface Configuration
        Parameters:
        newVisitListeners - The new visit listeners to be contained in the changed configuration.
        Returns:
        The changed configuration.
      • set

        public final Configuration set​(VisitListenerProvider... newVisitListenerProviders)
        Description copied from interface: Configuration
        Change this configuration to hold a new visit listener providers.

        This method is not thread-safe and should not be used in globally available Configuration objects.

        Specified by:
        set in interface Configuration
        Parameters:
        newVisitListenerProviders - The new visit listener providers to be contained in the changed configuration.
        Returns:
        The changed configuration.
      • set

        public final Configuration set​(TransactionListener... newTransactionListeners)
        Description copied from interface: Configuration
        Change this configuration to hold a new transaction listeners.

        This will wrap the argument TransactionListener in a DefaultTransactionListenerProvider for convenience.

        This method is not thread-safe and should not be used in globally available Configuration objects.

        Specified by:
        set in interface Configuration
        Parameters:
        newTransactionListeners - The new transaction listeners to be contained in the changed configuration.
        Returns:
        The changed configuration.
      • set

        public final Configuration set​(TransactionListenerProvider... newTransactionListenerProviders)
        Description copied from interface: Configuration
        Change this configuration to hold a new transaction listener providers.

        This method is not thread-safe and should not be used in globally available Configuration objects.

        Specified by:
        set in interface Configuration
        Parameters:
        newTransactionListenerProviders - The new transaction listener providers to be contained in the changed configuration.
        Returns:
        The changed configuration.
      • set

        public final Configuration set​(DiagnosticsListener... newDiagnosticsListeners)
        Description copied from interface: Configuration
        Change this configuration to hold a new diagnostics listeners.

        This will wrap the argument DiagnosticsListener in a DefaultDiagnosticsListenerProvider for convenience.

        This method is not thread-safe and should not be used in globally available Configuration objects.

        Specified by:
        set in interface Configuration
        Parameters:
        newDiagnosticsListeners - The new diagnostics listeners to be contained in the changed configuration.
        Returns:
        The changed configuration.
      • set

        public final Configuration set​(DiagnosticsListenerProvider... newDiagnosticsListenerProviders)
        Description copied from interface: Configuration
        Change this configuration to hold new diagnostics listener providers.

        This method is not thread-safe and should not be used in globally available Configuration objects.

        Specified by:
        set in interface Configuration
        Parameters:
        newDiagnosticsListenerProviders - The new diagnostics listener providers to be contained in the changed configuration.
        Returns:
        The changed configuration.
      • set

        public final Configuration set​(Unwrapper newUnwrapper)
        Description copied from interface: Configuration
        Change this configuration to hold a new unwrapper.

        This method is not thread-safe and should not be used in globally available Configuration objects.

        Specified by:
        set in interface Configuration
        Parameters:
        newUnwrapper - The new unwrapper to be contained in the changed configuration.
        Returns:
        The changed configuration.
      • set

        public final Configuration set​(UnwrapperProvider newUnwrapperProvider)
        Description copied from interface: Configuration
        Change this configuration to hold a new unwrapper provider.

        This method is not thread-safe and should not be used in globally available Configuration objects.

        Specified by:
        set in interface Configuration
        Parameters:
        newUnwrapperProvider - The new unwrapper provider to be contained in the changed configuration.
        Returns:
        The changed configuration.
      • set

        public final Configuration set​(ConverterProvider newConverterProvider)
        Description copied from interface: Configuration
        Change this configuration to hold a new converter provider.

        This method is not thread-safe and should not be used in globally available Configuration objects.

        Specified by:
        set in interface Configuration
        Parameters:
        newConverterProvider - The new converter provider to be contained in the changed configuration.
        Returns:
        The changed configuration.
      • set

        public final Configuration set​(Clock newClock)
        Description copied from interface: Configuration
        Change this configuration to hold a new Clock.

        This method is not thread-safe and should not be used in globally available Configuration objects.

        Specified by:
        set in interface Configuration
        Parameters:
        newClock - The new clock to be contained in the changed configuration.
        Returns:
        The changed configuration.
      • set

        public final Configuration set​(SQLDialect newDialect)
        Description copied from interface: Configuration
        Change this configuration to hold a new dialect.

        This method is not thread-safe and should not be used in globally available Configuration objects.

        Specified by:
        set in interface Configuration
        Parameters:
        newDialect - The new dialect to be contained in the changed configuration.
        Returns:
        The changed configuration.
      • set

        public final Configuration set​(Settings newSettings)
        Description copied from interface: Configuration
        Change this configuration to hold a new settings.

        This method is not thread-safe and should not be used in globally available Configuration objects.

        Specified by:
        set in interface Configuration
        Parameters:
        newSettings - The new settings to be contained in the changed configuration.
        Returns:
        The changed configuration.
      • setClock

        public final void setClock​(Clock newClock)
        See Also:
        set(Clock)
      • recordListenerProviders

        public final RecordListenerProvider[] recordListenerProviders()
        Description copied from interface: Configuration
        Get the configured RecordListenerProviders from this configuration.

        This method allows for retrieving the configured RecordListenerProvider from this configuration. The providers will provide jOOQ with RecordListener instances. These instances receive record manipulation notification events every time jOOQ executes queries. jOOQ makes no assumptions about the internal state of these listeners, i.e. listener instances may

        • share this Configuration's lifecycle (i.e. that of a JDBC Connection, or that of a transaction)
        • share the lifecycle of an RecordContext (i.e. that of a single record manipulation)
        • follow an entirely different lifecycle.
        Specified by:
        recordListenerProviders in interface Configuration
        Returns:
        The configured set of record listeners.
        See Also:
        RecordListenerProvider, RecordListener, RecordContext
      • executeListenerProviders

        public final ExecuteListenerProvider[] executeListenerProviders()
        Description copied from interface: Configuration
        Get the configured ExecuteListenerProviders from this configuration.

        This method allows for retrieving the configured ExecuteListenerProvider from this configuration. The providers will provide jOOQ with ExecuteListener instances. These instances receive execution lifecycle notification events every time jOOQ executes queries. jOOQ makes no assumptions about the internal state of these listeners, i.e. listener instances may

        • share this Configuration's lifecycle (i.e. that of a JDBC Connection, or that of a transaction)
        • share the lifecycle of an ExecuteContext (i.e. that of a single query execution)
        • follow an entirely different lifecycle.

        Note, depending on your Settings.isExecuteLogging(), some additional listeners may be prepended to this list, internally. Those listeners will never be exposed through this method, though.

        Specified by:
        executeListenerProviders in interface Configuration
        Returns:
        The configured set of execute listeners.
        See Also:
        ExecuteListenerProvider, ExecuteListener, ExecuteContext
      • visitListenerProviders

        public final VisitListenerProvider[] visitListenerProviders()
        Description copied from interface: Configuration
        Get the configured VisitListenerProvider instances from this configuration.

        This method allows for retrieving the configured VisitListenerProvider instances from this configuration. The providers will provide jOOQ with VisitListener instances. These instances receive query rendering lifecycle notification events every time jOOQ renders queries. jOOQ makes no assumptions about the internal state of these listeners, i.e. listener instances may

        • share this Configuration's lifecycle (i.e. that of a JDBC Connection, or that of a transaction)
        • share the lifecycle of an ExecuteContext (i.e. that of a single query execution)
        • follow an entirely different lifecycle.
        Specified by:
        visitListenerProviders in interface Configuration
        Returns:
        The configured set of visit listeners.
        See Also:
        VisitListenerProvider, VisitListener, VisitContext
      • clock

        public final Clock clock()
        Description copied from interface: Configuration
        Get this configuration's Clock, which is used for optimistic locking, transaction time, and other time-depending features.
        Specified by:
        clock in interface Configuration
      • data

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

        This is custom data that was previously set to the configuration using Configuration.data(Object, Object). Use custom data if you want to pass data to your custom QueryPart or ExecuteListener objects to be made available at render, bind, execution, fetch time.

        See ExecuteListener for more details.

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

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

        Use custom data if you want to pass data to your custom QueryPart or ExecuteListener objects to be made available at render, bind, execution, fetch time.

        Be sure that your custom data implements Serializable if you want to serialise this Configuration or objects referencing this Configuration, e.g. your Record types.

        See ExecuteListener for more details.

        Specified by:
        data in interface Configuration
        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
        See Also:
        ExecuteListener