Config interface.
This class serves as a central repository of default implementations for various components
used by the Doma framework. These default implementations are used when a custom Config
implementation does not override the corresponding methods.
Each field in this class represents a default implementation of a specific interface or
component that can be used by Config implementations. The default implementations provide
reasonable behavior for most applications, but can be replaced with custom implementations when
needed.
For example, the Config.getSqlFileRepository() method returns defaultSqlFileRepository by default, but a custom Config implementation can override
this method to provide a different SqlFileRepository implementation.
This design allows applications to customize only the components they need while using the default implementations for everything else, promoting a flexible and modular architecture.
All fields in this class are public, static, and final, making them effectively constants that
can be referenced directly if needed, though they are typically accessed through the default
methods of the Config interface.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final ClassHelperDefault implementation ofClassHelperfor class loading and instantiation.static final CommandImplementorsDefault implementation ofCommandImplementorsfor creating command objects.static final CommenterDefault implementation ofCommenterfor adding comments to SQL statements.static final DuplicateColumnHandlerDefault implementation ofDuplicateColumnHandlerthat uses the last occurrence.static final EntityListenerProviderDefault implementation ofEntityListenerProviderfor entity listeners.static final JdbcLoggerDefault implementation ofJdbcLoggerthat logs using java.util.logging.static final MapKeyNamingDefault implementation ofMapKeyNamingfor map key naming conventions.static final NamingDefault implementation ofNamingfor name conversion between Java and databases.static final QueryImplementorsDefault implementation ofQueryImplementorsfor creating query objects.static final RequiresNewControllerDefault implementation ofRequiresNewControllerfor transaction control.static final ScriptFileLoaderDefault implementation ofScriptFileLoaderthat provides basic script loading capabilities.static final SqlBuilderSettingsDefault implementation ofSqlBuilderSettingsfor SQL generation.static final SqlFileRepositoryDefault implementation ofSqlFileRepositorythat caches SQL files aggressively.static final StatisticManagerDefault implementation ofStatisticManagerfor collecting SQL execution statistics.static final UnknownColumnHandlerDefault implementation ofUnknownColumnHandlerthat throws an exception. -
Constructor Summary
Constructors -
Method Summary
-
Field Details
-
defaultSqlFileRepository
Default implementation ofSqlFileRepositorythat caches SQL files aggressively.This implementation uses a
GreedyCacheSqlFileRepositorywhich loads and caches SQL files when they are first accessed. The cached SQL files are kept in memory for the lifetime of the application, which improves performance but increases memory usage.Used by
Config.getSqlFileRepository()as the default return value. -
defaultScriptFileLoader
Default implementation ofScriptFileLoaderthat provides basic script loading capabilities.This implementation uses an anonymous inner class of
ScriptFileLoaderwith default behavior for loading SQL script files.Used by
Config.getScriptFileLoader()as the default return value. -
defaultJdbcLogger
Default implementation ofJdbcLoggerthat logs using java.util.logging.This implementation uses
UtilLoggingJdbcLoggerwhich delegates to the standard Java logging framework (java.util.logging) for logging SQL statements, parameters, and execution times.Used by
Config.getJdbcLogger()as the default return value. -
defaultRequiresNewController
Default implementation ofRequiresNewControllerfor transaction control.This implementation uses an anonymous inner class of
RequiresNewControllerwith default behavior for managing transactions with the REQUIRES_NEW attribute.Used by
Config.getRequiresNewController()as the default return value. -
defaultClassHelper
Default implementation ofClassHelperfor class loading and instantiation.This implementation uses an anonymous inner class of
ClassHelperwith default behavior for loading classes and creating instances.Used by
Config.getClassHelper()as the default return value. -
defaultCommandImplementors
Default implementation ofCommandImplementorsfor creating command objects.This implementation uses an anonymous inner class of
CommandImplementorswith default behavior for creating implementations of theCommandinterface.Used by
Config.getCommandImplementors()as the default return value. -
defaultQueryImplementors
Default implementation ofQueryImplementorsfor creating query objects.This implementation uses an anonymous inner class of
QueryImplementorswith default behavior for creating implementations of theQueryinterface.Used by
Config.getQueryImplementors()as the default return value. -
defaultUnknownColumnHandler
Default implementation ofUnknownColumnHandlerthat throws an exception.This implementation uses an anonymous inner class of
UnknownColumnHandlerwhich throws anUnknownColumnExceptionwhen it encounters a column in a result set that doesn't match any property in the corresponding entity class.Used by
Config.getUnknownColumnHandler()as the default return value. -
defaultDuplicateColumnHandler
Default implementation ofDuplicateColumnHandlerthat uses the last occurrence.This implementation uses an anonymous inner class of
DuplicateColumnHandlerwhich silently accepts duplicate columns in a result set and uses the last occurrence of each duplicate column when mapping to entity properties.Used by
Config.getDuplicateColumnHandler()as the default return value. -
defaultNaming
Default implementation ofNamingfor name conversion between Java and databases.This implementation uses
Naming.DEFAULTwhich provides the default naming convention for converting between Java property names and database column names.Used by
Config.getNaming()as the default return value. -
defaultMapKeyNaming
Default implementation ofMapKeyNamingfor map key naming conventions.This implementation uses an anonymous inner class of
MapKeyNamingwith default behavior for converting between database column names and keys in Map objects.Used by
Config.getMapKeyNaming()as the default return value. -
defaultCommenter
Default implementation ofCommenterfor adding comments to SQL statements.This implementation uses an anonymous inner class of
Commenterwhich adds no comments to SQL statements by default.Used by
Config.getCommenter()as the default return value. -
defaultEntityListenerProvider
Default implementation ofEntityListenerProviderfor entity listeners.This implementation uses an anonymous inner class of
EntityListenerProviderwhich creates one instance of each listener class per entity class. This means that the same listener instance is reused for all operations on entities of the same class.Used by
Config.getEntityListenerProvider()as the default return value. -
defaultSqlBuilderSettings
Default implementation ofSqlBuilderSettingsfor SQL generation.This implementation uses a new instance of
SqlBuilderSettingswith default settings for SQL generation.Used by
Config.getSqlBuilderSettings()as the default return value. -
defaultStatisticManager
Default implementation ofStatisticManagerfor collecting SQL execution statistics.This implementation uses
DefaultStatisticManagerwhich provides basic functionality for collecting and managing statistics about SQL execution.Used by
Config.getStatisticManager()as the default return value.
-
-
Constructor Details
-
ConfigSupport
public ConfigSupport()
-