- All Superinterfaces:
Config
Represents a simplified configuration interface that extends the base
Config interface.
It provides methods for accessing specific configuration components and constructing builder
instances for creating configuration objects.
SimpleConfig config = SimpleConfig.builder("jdbc:h2:mem:test")
.naming(Naming.SNAKE_UPPER_CASE)
.queryTimeout(10)
.build();
This configuration uses Doma's local transaction manager. If you're using Doma with Spring
Framework or Quarkus, avoid using this class.-
Method Summary
Modifier and TypeMethodDescriptionstatic SimpleConfigBuilderCreates a new instance ofSimpleConfigBuilderwith the specified URL.static SimpleConfigBuilderCreates a new instance ofSimpleConfigBuilderwith the specified database URL, username, and password.static SimpleConfigBuilderbuilder(DataSource dataSource, Dialect dialect) Creates a new instance ofSimpleConfigBuilderwith the specifiedDataSourceandDialect.Retrieves theLocalTransactionDataSourceassociated with this configuration.Retrieves theLocalTransactionManagerassociated with this configuration.Methods inherited from interface org.seasar.doma.jdbc.Config
getBatchSize, getClassHelper, getCommandImplementors, getCommenter, getDataSource, getDataSourceName, getDialect, getDuplicateColumnHandler, getEntityListenerProvider, getExceptionSqlLogType, getFetchSize, getJdbcLogger, getMapKeyNaming, getMaxRows, getNaming, getQueryImplementors, getQueryTimeout, getRequiresNewController, getScriptFileLoader, getSqlBuilderSettings, getSqlFileRepository, getStatisticManager, getTransactionManager, getUnknownColumnHandler
-
Method Details
-
getLocalTransactionDataSource
LocalTransactionDataSource getLocalTransactionDataSource()Retrieves theLocalTransactionDataSourceassociated with this configuration.- Returns:
- an instance of
LocalTransactionDataSourcefor managing local database connections and transactions
-
getLocalTransactionManager
LocalTransactionManager getLocalTransactionManager()Retrieves theLocalTransactionManagerassociated with this configuration.- Returns:
- an instance of
LocalTransactionManagerfor managing local transactions
-
builder
Creates a new instance ofSimpleConfigBuilderwith the specified URL.You can use a specially modified JDBC URL for Testcontainers as follows:
jdbc:tc:postgresql:12.20:///test?TC_DAEMON=trueTheDialectis inferred from the URL information.- Parameters:
url- the database URL to be used for the configuration; must not benull- Returns:
- an instance of
SimpleConfigBuilderinitialized with the given URL - Throws:
NullPointerException- if the URL isnull
-
builder
Creates a new instance ofSimpleConfigBuilderwith the specified database URL, username, and password.You can use a specially modified JDBC URL for Testcontainers as follows:
jdbc:tc:postgresql:12.20:///test?TC_DAEMON=trueTheDialectis inferred from the URL information.- Parameters:
url- the database URL to be used for the configuration; must not benulluser- the username to be used for the database connection; can benullpassword- the password to be used for the database connection; can benull- Returns:
- an instance of
SimpleConfigBuilderinitialized with the specified parameters - Throws:
NullPointerException- if the URL isnull
-
builder
Creates a new instance ofSimpleConfigBuilderwith the specifiedDataSourceandDialect.- Parameters:
dataSource- the data source to be used for the configuration; must not benulldialect- the dialect to be used for the configuration; must not benull- Returns:
- an instance of
SimpleConfigBuilderinitialized with the providedDataSourceandDialect - Throws:
NullPointerException- if thedataSourceordialectisnull
-