- All Implemented Interfaces:
DatabaseBuilder
,DatabaseBuilder.Settings
Used to programmatically construct an Database and optionally register it with the DB singleton.
If you just use DB thout this programmatic configuration Ebean will read the application.properties file and take the configuration from there. This usually includes searching the class path and automatically registering any entity classes and listeners etc.
DatabaseConfig config = new DatabaseConfig();
// read the ebean.properties and load
// those settings into this DatabaseConfig object
config.loadFromProperties();
// explicitly register the entity beans to avoid classpath scanning
config.addClass(Customer.class);
config.addClass(User.class);
Database db = DatabaseFactory.create(config);
Note that DatabaseConfigProvider provides a standard Java ServiceLoader mechanism that can be used to apply configuration to the DatabaseConfig.
- Author:
- emcgreal, rbygrave
- See Also:
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from interface io.ebean.DatabaseBuilder
DatabaseBuilder.Settings
-
Constructor Summary
ConstructorsConstructorDescriptionConstruct a Database Configuration for programmatically creating an Database. -
Method Summary
Modifier and TypeMethodDescriptionadd
(IdGenerator idGenerator) Register a customer IdGenerator instance.add
(BeanPersistController beanPersistController) Register a BeanPersistController instance.add
(BeanPersistListener beanPersistListener) Register a BeanPersistListener instance.add
(BeanPostConstructListener listener) Register a BeanPostConstructListener instance.add
(BeanPostLoad postLoad) Register a BeanPostLoad instance.add
(BeanQueryAdapter beanQueryAdapter) Register a BeanQueryAdapter instance.add
(BulkTableEventListener bulkTableEventListener) Add a BulkTableEventListeneraddAll
(Collection<Class<?>> classList) Register all the classes (typically entity classes).Programmatically add classes (typically entities) that this server should use.addCustomMapping
(DbType type, String columnDefinition) Add a custom type mapping that applies to all platforms.addCustomMapping
(DbType type, String columnDefinition, io.ebean.annotation.Platform platform) Add a custom type mapping.addMappingLocation
(String mappingLocation) Add a mapping location to search for xml mapping via class path search.addPackage
(String packageName) Add a package to search for entities via class path search.addServerConfigStartup
(ServerConfigStartup configStartupListener) Add a ServerConfigStartup.io.ebean.annotation.PersistBatch
Return the PersistBatch mode to use for 'batchOnCascade' taking into account if the database platform supports getGeneratedKeys in batch mode.apply
(Consumer<DatabaseBuilder.Settings> applyConfiguration) Apply configuration to this builder using a lambda.build()
Build and return the Database instance.classes()
Return the classes registered for this database.classes
(Collection<Class<?>> classes) Set the list of classes (entities, listeners, scalarTypes etc) that should be used for this database.Return the database column used to support history and 'As of' queries.Return the suffix appended to the base table to derive the view that contains the union of the base table and the history table in order to support asOf queries.Return the configuration for AutoTune.int
Return the Background executor schedule pool size.int
Return the Background executor shutdown seconds.Return the background executor wrapper.Return the list of BulkTableEventListener instances.int
Return the L2 cache default max idle time in seconds.int
Return the L2 cache default max size.int
Return the L2 cache default max time to live in seconds.Return the ChangeLogListener which actually performs the logging of change sets in the background.Return the ChangeLogPrepare.Return the ChangeLogRegister which controls which ChangeLogFilter is used for each bean type and in this way provide fine grained control over which persist requests are included in the change log.Deprecated, for removal: This API element is subject to removal in a future version.Return the ClassLoadConfig which is used to detect Joda, Java8 types etc and also create new instances of plugins given a className.getClock()
Get the clock used for setting the timestamps (e.g.Return the constraint naming convention used in DDL generation.Return the container / clustering configuration.Return the current tenant provider.Return the CurrentUserProvider.Return a value used to represent FALSE in the database.Return a value used to represent TRUE in the database.Return the database platform to use for this database.Return the database platform name (can be null).int
Return the number of DB sequence values that should be preallocated.Return the DataSource.io.ebean.datasource.DataSourceBuilder.Settings
Return the configuration to build a DataSource using Ebean's own DataSource implementation.Return the time zone to use when reading/writing Timestamps via JDBC.Return the DbEncrypt used to encrypt and decrypt properties.Return the DB schema to use.Return the header to use with DDL generation.Return a SQL script to execute before the "create all" DDL has been run.Return a map of placeholder values that are substituted in DDL scripts.Return a comma and equals delimited placeholders that are substituted in DDL scripts.Return SQL script to execute after the "create all" DDL has been run.jakarta.persistence.EnumType
Return the options for dumping metrics.Return the enabled L2 cache regions.Return the EncryptDeployManager.Return the EncryptKeyManager.Return the Encryptor used to encrypt data on the java client side (as opposed to DB encryption functions).Return the external transaction manager.Return the list of BeanFindController instances.int
Return the Geometry SRID.Return the history table suffix (defaults to _history).Return the custom IdGenerator instances.Return the preferred DB platform IdType.int
Return the default JDBC fetchSize hint for findEach/findEachWhile queries.int
Return the default JDBC fetchSize hint for findList queries.Return the mode to use for Joda LocalTime support 'normal' or 'utc'.Return the JSON format used for Date types.Return the JSON format used for DateTime types.com.fasterxml.jackson.core.JsonFactory
Return the Jackson JsonFactory to use.Return the JSON include mode used when writing JSON.io.ebean.annotation.MutationDetection
Return the default MutableDetection to use with@DbJson
using Jackson.int
Return the default batch size for lazy loading of beans and collections.Returns the length check mode.Return mapping locations to search for xml mapping via class path search.int
Return the max call stack to use for origin location.Return the naming convention to apply to metrics names.getName()
Return the name of the Database.Return the NamingConvention.Return the Jackson ObjectMapper.Return packages to search for entities via class path search.io.ebean.annotation.PersistBatch
Return the PersistBatch mode to use by default at the transaction level.io.ebean.annotation.PersistBatch
Return the JDBC batch mode to use per save(), delete(), insert() or update() request.int
Return the batch size used for JDBC batching.Return the BeanPersistController instances.Return the default PersistenceContextScope to be used if one is not explicitly set on a query.Return the BeanPersistListener instances.Return the configuration for DB types (such as UUID and custom mappings).Return the list of BeanPostLoader instances.Return the list of BeanPostLoader instances.Return the configuration for profiling.Return the properties that we used for configuration and were set via a call to loadFromProperties().Return the BeanQueryAdapter instances.int
Gets the query batch size.int
Return the L2 query cache default max idle time in seconds.int
Return the L2 query cache default max size.int
Return the L2 query cache default max time to live in seconds.int
Return the max number of query plans captured per request.long
Return the time after which a capture query plans request will stop capturing more query plans.long
Return the frequency to capture query plans.Return the listener used to process captured query plans.long
Return the query plan collection threshold in microseconds.int
Return the time to live for ebean's internal query plan.Return the read only DataSource.io.ebean.datasource.DataSourceBuilder.Settings
Return the configuration for the read only DataSource.Returns the resource directory.Return the ServerCachePlugin.Return the list of ServerConfigStartup instances.<P> P
getServiceObject
(Class<P> cls) Used by ebean or plugins to obtain service objects.getServiceObject
(String key) Return the service object given the key.Return the slow query event listener.long
Return the slow query time in millis.Return the tenancy catalog provider.Return the tenancy datasource provider.Return the tenancy mode used.Return the column name used for TenantMode.PARTITION.Return the tenancy schema provider.Returns the V1-UUID-NodeIdReturn the UUID state file.Returns the UUID version mode.includeLabelInSql
(boolean includeLabelInSql) Set if generated SQL SELECT should include the query label as an inline SQL comment (to help reference back from the SQL to the code that executed the query.boolean
Return true if all DB column and table names should use quoted identifiers.boolean
Deprecated, for removal: This API element is subject to removal in a future version.- migrate toisLoadModuleInfo()
.boolean
Return true if dirty beans are automatically persisted.boolean
Return true if Ebean should create a DataSource for use with implicit read only transactions.boolean
Return true (default) if the changelog should be written async.boolean
Return true if inserts should be included in the change log by default.boolean
Return true if the Database instance should be created in offline mode.boolean
Return true if the "drop all ddl" should be skipped.boolean
Return true, if extra-ddl.xml should be executed.boolean
Return true if the DDL should be generated.boolean
isDdlRun()
Return true if the DDL should be run.boolean
Return true if strict mode is used which includes a check that non-null columns have a default value.boolean
Return true if this server should be registered as the "default" server with the Ebean singleton.boolean
Return true if the class path search should be disabled.boolean
Return true if L2 cache is disabled.boolean
Return true if lazy loading is disabled on queries by default.boolean
Return true if metrics should be dumped when the server is shutdown.boolean
Return true if Duration should be persisted with nanos precision (SQL DECIMAL).boolean
Return true if LOB's should default to fetch eager.boolean
Return true if eq("someProperty", null) should to generate "1=1" rather than "is null" sql expression.boolean
Return true if native ILIKE expression should be used if supported by the database platform (e.g.boolean
When false we need explicit@GeneratedValue
mapping to assign Identity or Sequence generated values.boolean
Return true if generated sql select query should include an inline sql comment with the query label or profile location label.boolean
Return true if entity classes should be loaded and registered via EntityClassRegister.boolean
Return true to use local only L2 cache.boolean
Return true if LocalTime should be persisted with nanos precision.boolean
Return true if L2 cache notification should run in the foreground.boolean
Return true if periodic capture of query plans is enabled.boolean
Return true if query plan capture is enabled.boolean
Return true if this server should be registered with the Ebean singleton when it is created.boolean
Return true if the DB migration should run on server start.boolean
Return true if L2 bean cache should be skipped once writes have occurred on a transaction.boolean
Return true if transactions should rollback on checked exceptions.boolean
Returns true if updates in JDBC batch default to include all properties by default.boolean
Return true if we are running in a JTA Transaction manager.boolean
Returns if we use javax.validation.constraints.NotNulllengthCheck
(LengthCheck lengthCheck) Sets the length check mode.protected void
This is broken out to allow overridden behaviour.protected void
loads the data source settings to preserve existing behaviour.Load settings from application.properties, application.yaml and other sources.loadFromProperties
(Properties properties) Load the settings from the given propertiesprotected void
Load the configuration settings from the properties file.newPlatformConfig
(String propertiesPath, String platformPrefix) Create a new PlatformConfig based of the one held but with overridden properties by reading properties with the given path and prefix.<T> DatabaseConfig
putServiceObject
(Class<T> iface, T configObject) Put a service object into configuration such that it can be used by ebean or a plugin.putServiceObject
(Object configObject) Put a service object into configuration such that it can be used by ebean or a plugin.putServiceObject
(String key, Object configObject) Put a service object into configuration such that it can be used by ebean or a plugin.boolean
Return true if this database is used in a read only way.readOnlyDatabase
(boolean readOnlyDatabase) Set to true if this database is used in a read only way.setAllQuotedIdentifiers
(boolean allQuotedIdentifiers) setAsOfSysPeriod
(String asOfSysPeriod) setAsOfViewSuffix
(String asOfViewSuffix) setAutoPersistUpdates
(boolean autoPersistUpdates) setAutoReadOnlyDataSource
(boolean autoReadOnlyDataSource) setAutoTuneConfig
(AutoTuneConfig autoTuneConfig) setBackgroundExecutorSchedulePoolSize
(int backgroundExecutorSchedulePoolSize) setBackgroundExecutorShutdownSecs
(int backgroundExecutorShutdownSecs) setBackgroundExecutorWrapper
(BackgroundExecutorWrapper backgroundExecutorWrapper) setCacheMaxIdleTime
(int cacheMaxIdleTime) setCacheMaxSize
(int cacheMaxSize) setCacheMaxTimeToLive
(int cacheMaxTimeToLive) setChangeLogAsync
(boolean changeLogAsync) setChangeLogIncludeInserts
(boolean changeLogIncludeInserts) setChangeLogListener
(ChangeLogListener changeLogListener) setChangeLogPrepare
(ChangeLogPrepare changeLogPrepare) setChangeLogRegister
(ChangeLogRegister changeLogRegister) void
setClasses
(Collection<Class<?>> classes) Set the list of classes (entities, listeners, scalarTypes etc) that should be used for this database.setClassLoadConfig
(ClassLoadConfig classLoadConfig) setConstraintNaming
(DbConstraintNaming constraintNaming) setContainerConfig
(ContainerConfig containerConfig) setCurrentTenantProvider
(CurrentTenantProvider currentTenantProvider) setCurrentUserProvider
(CurrentUserProvider currentUserProvider) setDatabaseBooleanFalse
(String databaseFalse) setDatabaseBooleanTrue
(String databaseTrue) setDatabasePlatform
(DatabasePlatform databasePlatform) setDatabasePlatformName
(String databasePlatformName) setDatabaseSequenceBatch
(int databaseSequenceBatchSize) setDatabaseSequenceBatchSize
(int databaseSequenceBatchSize) setDataSource
(DataSource dataSource) setDataSourceConfig
(io.ebean.datasource.DataSourceBuilder dataSourceConfig) setDataTimeZone
(String dataTimeZone) setDbEncrypt
(DbEncrypt dbEncrypt) setDbOffline
(boolean dbOffline) setDbSchema
(String dbSchema) setDbUuid
(PlatformConfig.DbUuid dbUuid) setDdlCreateOnly
(boolean ddlCreateOnly) setDdlExtra
(boolean ddlExtra) setDdlGenerate
(boolean ddlGenerate) setDdlHeader
(String ddlHeader) setDdlInitSql
(String ddlInitSql) setDdlPlaceholderMap
(Map<String, String> ddlPlaceholderMap) setDdlPlaceholders
(String ddlPlaceholders) setDdlRun
(boolean ddlRun) setDdlSeedSql
(String ddlSeedSql) setDdlStrictMode
(boolean ddlStrictMode) setDefaultEnumType
(jakarta.persistence.EnumType defaultEnumType) setDefaultServer
(boolean defaultServer) setDisableClasspathSearch
(boolean disableClasspathSearch) setDisableL2Cache
(boolean disableL2Cache) setDisableLazyLoading
(boolean disableLazyLoading) setDumpMetricsOnShutdown
(boolean dumpMetricsOnShutdown) setDumpMetricsOptions
(String dumpMetricsOptions) setDurationWithNanos
(boolean durationWithNanos) setEagerFetchLobs
(boolean eagerFetchLobs) setEnabledL2Regions
(String enabledL2Regions) setEncryptDeployManager
(EncryptDeployManager encryptDeployManager) setEncryptKeyManager
(EncryptKeyManager encryptKeyManager) setEncryptor
(Encryptor encryptor) setExpressionEqualsWithNullAsNoop
(boolean expressionEqualsWithNullAsNoop) setExpressionNativeIlike
(boolean expressionNativeIlike) setExternalTransactionManager
(ExternalTransactionManager externalTransactionManager) setFindControllers
(List<BeanFindController> findControllers) Set the list of BeanFindController instances.setGeometrySRID
(int geometrySRID) setHistoryTableSuffix
(String historyTableSuffix) setIdGeneratorAutomatic
(boolean idGeneratorAutomatic) setIdGenerators
(List<IdGenerator> idGenerators) Set the custom IdGenerator instances.setJdbcFetchSizeFindEach
(int jdbcFetchSizeFindEach) setJdbcFetchSizeFindList
(int jdbcFetchSizeFindList) setJodaLocalTimeMode
(String jodaLocalTimeMode) setJsonDate
(JsonConfig.Date jsonDate) setJsonDateTime
(JsonConfig.DateTime jsonDateTime) setJsonFactory
(com.fasterxml.jackson.core.JsonFactory jsonFactory) setJsonInclude
(JsonConfig.Include jsonInclude) setJsonMutationDetection
(io.ebean.annotation.MutationDetection jsonMutationDetection) setLazyLoadBatchSize
(int lazyLoadBatchSize) setLoadModuleInfo
(boolean loadModuleInfo) setLocalOnlyL2Cache
(boolean localOnlyL2Cache) setLocalTimeWithNanos
(boolean localTimeWithNanos) setMappingLocations
(List<String> mappingLocations) setMaxCallStack
(int maxCallStack) setMetricNaming
(Function<String, String> metricNaming) setNamingConvention
(NamingConvention namingConvention) setNotifyL2CacheInForeground
(boolean notifyL2CacheInForeground) setObjectMapper
(Object objectMapper) setPackages
(List<String> packages) Set packages to search for entities via class path search.setPersistBatch
(io.ebean.annotation.PersistBatch persistBatch) setPersistBatching
(boolean persistBatching) setPersistBatchOnCascade
(io.ebean.annotation.PersistBatch persistBatchOnCascade) setPersistBatchSize
(int persistBatchSize) setPersistControllers
(List<BeanPersistController> persistControllers) Register all the BeanPersistController instances.setPersistenceContextScope
(PersistenceContextScope persistenceContextScope) setPersistListeners
(List<BeanPersistListener> persistListeners) Register all the BeanPersistListener instances.setPlatformConfig
(PlatformConfig platformConfig) setPostConstructListeners
(List<BeanPostConstructListener> listeners) Set the list of BeanPostLoader instances.setPostLoaders
(List<BeanPostLoad> postLoaders) Set the list of BeanPostLoader instances.setProfilingConfig
(ProfilingConfig profilingConfig) setQueryAdapters
(List<BeanQueryAdapter> queryAdapters) Register all the BeanQueryAdapter instances.setQueryBatchSize
(int queryBatchSize) setQueryCacheMaxIdleTime
(int queryCacheMaxIdleTime) setQueryCacheMaxSize
(int queryCacheMaxSize) setQueryCacheMaxTimeToLive
(int queryCacheMaxTimeToLive) setQueryPlanCapture
(boolean queryPlanCapture) setQueryPlanCaptureMaxCount
(int queryPlanCaptureMaxCount) setQueryPlanCaptureMaxTimeMillis
(long queryPlanCaptureMaxTimeMillis) setQueryPlanCapturePeriodSecs
(long queryPlanCapturePeriodSecs) setQueryPlanEnable
(boolean queryPlanEnable) setQueryPlanListener
(QueryPlanListener queryPlanListener) setQueryPlanThresholdMicros
(long queryPlanThresholdMicros) setQueryPlanTTLSeconds
(int queryPlanTTLSeconds) setReadOnlyDataSource
(DataSource readOnlyDataSource) setReadOnlyDataSourceConfig
(io.ebean.datasource.DataSourceBuilder readOnly) setRegister
(boolean register) setResourceDirectory
(String resourceDirectory) setRunMigration
(boolean runMigration) setServerCachePlugin
(ServerCachePlugin serverCachePlugin) setSkipCacheAfterWrite
(boolean skipCacheAfterWrite) setSkipDataSourceCheck
(boolean skipDataSourceCheck) setSlowQueryListener
(SlowQueryListener slowQueryListener) setSlowQueryMillis
(long slowQueryMillis) setTenantCatalogProvider
(TenantCatalogProvider tenantCatalogProvider) setTenantDataSourceProvider
(TenantDataSourceProvider tenantDataSourceProvider) setTenantMode
(TenantMode tenantMode) setTenantPartitionColumn
(String tenantPartitionColumn) setTenantSchemaProvider
(TenantSchemaProvider tenantSchemaProvider) settings()
Return the settings to read the configuration that has been set.setTransactionRollbackOnChecked
(boolean transactionRollbackOnChecked) setUpdateAllPropertiesInBatch
(boolean updateAllPropertiesInBatch) setUseJtaTransactionManager
(boolean useJtaTransactionManager) setUseValidationNotNull
(boolean useValidationNotNull) setUuidNodeId
(String uuidNodeId) setUuidStateFile
(String uuidStateFile) setUuidVersion
(DatabaseConfig.UuidVersion uuidVersion) boolean
Return true if the startup DataSource check should be skipped.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface io.ebean.DatabaseBuilder
allQuotedIdentifiers, alsoIf, asOfSysPeriod, asOfViewSuffix, autoPersistUpdates, autoReadOnlyDataSource, autoTuneConfig, backgroundExecutorSchedulePoolSize, backgroundExecutorShutdownSecs, backgroundExecutorWrapper, cacheMaxIdleTime, cacheMaxSize, cacheMaxTimeToLive, changeLogAsync, changeLogIncludeInserts, changeLogListener, changeLogPrepare, changeLogRegister, classLoadConfig, clock, constraintNaming, containerConfig, currentTenantProvider, currentUserProvider, databaseBooleanFalse, databaseBooleanTrue, databasePlatform, databasePlatformName, databaseSequenceBatch, databaseSequenceBatchSize, dataSource, dataSourceBuilder, dataTimeZone, dbEncrypt, dbSchema, dbUuid, ddlCreateOnly, ddlExtra, ddlGenerate, ddlHeader, ddlInitSql, ddlPlaceholderMap, ddlPlaceholders, ddlRun, ddlSeedSql, ddlStrictMode, defaultDatabase, defaultEnumType, disableClasspathSearch, disableL2Cache, disableLazyLoading, dumpMetricsOnShutdown, dumpMetricsOptions, durationWithNanos, eagerFetchLobs, enabledL2Regions, encryptDeployManager, encryptKeyManager, encryptor, expressionEqualsWithNullAsNoop, expressionNativeIlike, externalTransactionManager, geometrySRID, historyTableSuffix, idGeneratorAutomatic, idType, jdbcFetchSizeFindEach, jdbcFetchSizeFindList, jodaLocalTimeMode, jsonDate, jsonDateTime, jsonFactory, jsonInclude, jsonMutationDetection, lazyLoadBatchSize, loadModuleInfo, localOnlyL2Cache, localTimeWithNanos, mappingLocations, maxCallStack, metricNaming, name, namingConvention, notifyL2CacheInForeground, objectMapper, offline, persistBatch, persistBatching, persistBatchOnCascade, persistBatchSize, persistenceContextScope, platformConfig, profilingConfig, queryBatchSize, queryCacheMaxIdleTime, queryCacheMaxSize, queryCacheMaxTimeToLive, queryPlanCapture, queryPlanCaptureMaxCount, queryPlanCaptureMaxTimeMillis, queryPlanCapturePeriodSecs, queryPlanEnable, queryPlanListener, queryPlanThresholdMicros, queryPlanTTLSeconds, readOnlyDataSource, readOnlyDataSourceBuilder, register, resourceDirectory, runMigration, serverCachePlugin, skipCacheAfterWrite, skipDataSourceCheck, slowQueryListener, slowQueryMillis, tenantCatalogProvider, tenantDataSourceProvider, tenantMode, tenantPartitionColumn, tenantSchemaProvider, transactionRollbackOnChecked, updateAllPropertiesInBatch, useJtaTransactionManager, useValidationNotNull, uuidNodeId, uuidStateFile, uuidVersion
-
Constructor Details
-
DatabaseConfig
public DatabaseConfig()Construct a Database Configuration for programmatically creating an Database.
-
-
Method Details
-
build
Description copied from interface:DatabaseBuilder
Build and return the Database instance.- Specified by:
build
in interfaceDatabaseBuilder
-
settings
Description copied from interface:DatabaseBuilder
Return the settings to read the configuration that has been set. This provides the getters/accessors to read the configuration properties.- Specified by:
settings
in interfaceDatabaseBuilder
-
apply
Description copied from interface:DatabaseBuilder
Apply configuration to this builder using a lambda.- Specified by:
apply
in interfaceDatabaseBuilder
-
getClock
Description copied from interface:DatabaseBuilder.Settings
Get the clock used for setting the timestamps (e.g. @UpdatedTimestamp) on objects.- Specified by:
getClock
in interfaceDatabaseBuilder.Settings
-
setClock
- Specified by:
setClock
in interfaceDatabaseBuilder
-
getSlowQueryMillis
public long getSlowQueryMillis()Description copied from interface:DatabaseBuilder.Settings
Return the slow query time in millis.- Specified by:
getSlowQueryMillis
in interfaceDatabaseBuilder.Settings
-
setSlowQueryMillis
- Specified by:
setSlowQueryMillis
in interfaceDatabaseBuilder
-
getSlowQueryListener
Description copied from interface:DatabaseBuilder.Settings
Return the slow query event listener.- Specified by:
getSlowQueryListener
in interfaceDatabaseBuilder.Settings
-
setSlowQueryListener
- Specified by:
setSlowQueryListener
in interfaceDatabaseBuilder
-
putServiceObject
Description copied from interface:DatabaseBuilder
Put a service object into configuration such that it can be used by ebean or a plugin.For example, put IgniteConfiguration in to be passed to the Ignite plugin.
- Specified by:
putServiceObject
in interfaceDatabaseBuilder
-
putServiceObject
Description copied from interface:DatabaseBuilder
Put a service object into configuration such that it can be used by ebean or a plugin.For example, put IgniteConfiguration in to be passed to the Ignite plugin. You can also override some SPI objects that should be used for that Database. Currently, the following objects are possible.
- DataSourceAlertFactory (e.g. add different alert factories for different ebean instances)
- DocStoreFactory
- SlowQueryListener (e.g. add custom query listener for a certain ebean instance)
- ServerCacheNotifyPlugin
- Specified by:
putServiceObject
in interfaceDatabaseBuilder
-
getServiceObject
Description copied from interface:DatabaseBuilder.Settings
Return the service object given the key.- Specified by:
getServiceObject
in interfaceDatabaseBuilder.Settings
-
putServiceObject
Description copied from interface:DatabaseBuilder
Put a service object into configuration such that it can be used by ebean or a plugin.JedisPool jedisPool = .. config.putServiceObject(jedisPool);
- Specified by:
putServiceObject
in interfaceDatabaseBuilder
-
getServiceObject
Description copied from interface:DatabaseBuilder.Settings
Used by ebean or plugins to obtain service objects.JedisPool jedisPool = config.getServiceObject(JedisPool.class);
- Specified by:
getServiceObject
in interfaceDatabaseBuilder.Settings
- Parameters:
cls
- The type of the service object to obtain- Returns:
- The service object given the class type
-
getJsonFactory
public com.fasterxml.jackson.core.JsonFactory getJsonFactory()Description copied from interface:DatabaseBuilder.Settings
Return the Jackson JsonFactory to use.If not set a default implementation will be used.
- Specified by:
getJsonFactory
in interfaceDatabaseBuilder.Settings
-
setJsonFactory
- Specified by:
setJsonFactory
in interfaceDatabaseBuilder
-
getJsonDateTime
Description copied from interface:DatabaseBuilder.Settings
Return the JSON format used for DateTime types.- Specified by:
getJsonDateTime
in interfaceDatabaseBuilder.Settings
-
setJsonDateTime
- Specified by:
setJsonDateTime
in interfaceDatabaseBuilder
-
getJsonDate
Description copied from interface:DatabaseBuilder.Settings
Return the JSON format used for Date types.- Specified by:
getJsonDate
in interfaceDatabaseBuilder.Settings
-
setJsonDate
- Specified by:
setJsonDate
in interfaceDatabaseBuilder
-
getJsonInclude
Description copied from interface:DatabaseBuilder.Settings
Return the JSON include mode used when writing JSON.- Specified by:
getJsonInclude
in interfaceDatabaseBuilder.Settings
-
setJsonInclude
- Specified by:
setJsonInclude
in interfaceDatabaseBuilder
-
getJsonMutationDetection
public io.ebean.annotation.MutationDetection getJsonMutationDetection()Description copied from interface:DatabaseBuilder.Settings
Return the default MutableDetection to use with@DbJson
using Jackson.- Specified by:
getJsonMutationDetection
in interfaceDatabaseBuilder.Settings
- See Also:
-
setJsonMutationDetection
public DatabaseConfig setJsonMutationDetection(io.ebean.annotation.MutationDetection jsonMutationDetection) - Specified by:
setJsonMutationDetection
in interfaceDatabaseBuilder
-
getName
Description copied from interface:DatabaseBuilder.Settings
Return the name of the Database.- Specified by:
getName
in interfaceDatabaseBuilder.Settings
-
setName
- Specified by:
setName
in interfaceDatabaseBuilder
-
getContainerConfig
Description copied from interface:DatabaseBuilder.Settings
Return the container / clustering configuration. The container holds all the Database instances and provides clustering communication services to all the Database instances.- Specified by:
getContainerConfig
in interfaceDatabaseBuilder.Settings
-
setContainerConfig
- Specified by:
setContainerConfig
in interfaceDatabaseBuilder
-
isRegister
public boolean isRegister()Description copied from interface:DatabaseBuilder.Settings
Return true if this server should be registered with the Ebean singleton when it is created.By default this is set to true.
- Specified by:
isRegister
in interfaceDatabaseBuilder.Settings
-
setRegister
- Specified by:
setRegister
in interfaceDatabaseBuilder
-
isDefaultServer
public boolean isDefaultServer()Description copied from interface:DatabaseBuilder.Settings
Return true if this server should be registered as the "default" server with the Ebean singleton.This is only used when
DatabaseBuilder.setRegister(boolean)
is also true.- Specified by:
isDefaultServer
in interfaceDatabaseBuilder.Settings
-
setDefaultServer
- Specified by:
setDefaultServer
in interfaceDatabaseBuilder
-
getCurrentUserProvider
Description copied from interface:DatabaseBuilder.Settings
Return the CurrentUserProvider. This is used to populate @WhoCreated, @WhoModified and support other audit features (who executed a query etc).- Specified by:
getCurrentUserProvider
in interfaceDatabaseBuilder.Settings
-
setCurrentUserProvider
- Specified by:
setCurrentUserProvider
in interfaceDatabaseBuilder
-
getTenantMode
Description copied from interface:DatabaseBuilder.Settings
Return the tenancy mode used.- Specified by:
getTenantMode
in interfaceDatabaseBuilder.Settings
-
setTenantMode
- Specified by:
setTenantMode
in interfaceDatabaseBuilder
-
getTenantPartitionColumn
Description copied from interface:DatabaseBuilder.Settings
Return the column name used for TenantMode.PARTITION.- Specified by:
getTenantPartitionColumn
in interfaceDatabaseBuilder.Settings
-
setTenantPartitionColumn
- Specified by:
setTenantPartitionColumn
in interfaceDatabaseBuilder
-
getCurrentTenantProvider
Description copied from interface:DatabaseBuilder.Settings
Return the current tenant provider.- Specified by:
getCurrentTenantProvider
in interfaceDatabaseBuilder.Settings
-
setCurrentTenantProvider
- Specified by:
setCurrentTenantProvider
in interfaceDatabaseBuilder
-
getTenantDataSourceProvider
Description copied from interface:DatabaseBuilder.Settings
Return the tenancy datasource provider.- Specified by:
getTenantDataSourceProvider
in interfaceDatabaseBuilder.Settings
-
setTenantDataSourceProvider
public DatabaseConfig setTenantDataSourceProvider(TenantDataSourceProvider tenantDataSourceProvider) - Specified by:
setTenantDataSourceProvider
in interfaceDatabaseBuilder
-
getTenantSchemaProvider
Description copied from interface:DatabaseBuilder.Settings
Return the tenancy schema provider.- Specified by:
getTenantSchemaProvider
in interfaceDatabaseBuilder.Settings
-
setTenantSchemaProvider
- Specified by:
setTenantSchemaProvider
in interfaceDatabaseBuilder
-
getTenantCatalogProvider
Description copied from interface:DatabaseBuilder.Settings
Return the tenancy catalog provider.- Specified by:
getTenantCatalogProvider
in interfaceDatabaseBuilder.Settings
-
setTenantCatalogProvider
- Specified by:
setTenantCatalogProvider
in interfaceDatabaseBuilder
-
isAutoPersistUpdates
public boolean isAutoPersistUpdates()Description copied from interface:DatabaseBuilder.Settings
Return true if dirty beans are automatically persisted.- Specified by:
isAutoPersistUpdates
in interfaceDatabaseBuilder.Settings
-
setAutoPersistUpdates
- Specified by:
setAutoPersistUpdates
in interfaceDatabaseBuilder
-
getPersistBatch
public io.ebean.annotation.PersistBatch getPersistBatch()Description copied from interface:DatabaseBuilder.Settings
Return the PersistBatch mode to use by default at the transaction level.When INSERT or ALL is used then save(), delete() etc do not execute immediately but instead go into a JDBC batch execute buffer that is flushed. The buffer is flushed if a query is executed, transaction ends or the batch size is meet.
- Specified by:
getPersistBatch
in interfaceDatabaseBuilder.Settings
-
setPersistBatch
- Specified by:
setPersistBatch
in interfaceDatabaseBuilder
-
getPersistBatchOnCascade
public io.ebean.annotation.PersistBatch getPersistBatchOnCascade()Description copied from interface:DatabaseBuilder.Settings
Return the JDBC batch mode to use per save(), delete(), insert() or update() request.This makes sense when a save() or delete() cascades and executes multiple child statements. The best case for this is when saving a master/parent bean this cascade inserts many detail/child beans.
This only takes effect when the persistBatch mode at the transaction level does not take effect.
- Specified by:
getPersistBatchOnCascade
in interfaceDatabaseBuilder.Settings
-
setPersistBatchOnCascade
public DatabaseConfig setPersistBatchOnCascade(io.ebean.annotation.PersistBatch persistBatchOnCascade) - Specified by:
setPersistBatchOnCascade
in interfaceDatabaseBuilder
-
setPersistBatching
- Specified by:
setPersistBatching
in interfaceDatabaseBuilder
-
getPersistBatchSize
public int getPersistBatchSize()Description copied from interface:DatabaseBuilder.Settings
Return the batch size used for JDBC batching. This defaults to 20.- Specified by:
getPersistBatchSize
in interfaceDatabaseBuilder.Settings
-
setPersistBatchSize
- Specified by:
setPersistBatchSize
in interfaceDatabaseBuilder
-
getQueryBatchSize
public int getQueryBatchSize()Description copied from interface:DatabaseBuilder.Settings
Gets the query batch size. This defaults to 100.- Specified by:
getQueryBatchSize
in interfaceDatabaseBuilder.Settings
- Returns:
- the query batch size
-
setQueryBatchSize
- Specified by:
setQueryBatchSize
in interfaceDatabaseBuilder
-
getDefaultEnumType
public jakarta.persistence.EnumType getDefaultEnumType()- Specified by:
getDefaultEnumType
in interfaceDatabaseBuilder.Settings
-
setDefaultEnumType
- Specified by:
setDefaultEnumType
in interfaceDatabaseBuilder
-
isDisableLazyLoading
public boolean isDisableLazyLoading()Description copied from interface:DatabaseBuilder.Settings
Return true if lazy loading is disabled on queries by default.- Specified by:
isDisableLazyLoading
in interfaceDatabaseBuilder.Settings
-
setDisableLazyLoading
- Specified by:
setDisableLazyLoading
in interfaceDatabaseBuilder
-
getLazyLoadBatchSize
public int getLazyLoadBatchSize()Description copied from interface:DatabaseBuilder.Settings
Return the default batch size for lazy loading of beans and collections.- Specified by:
getLazyLoadBatchSize
in interfaceDatabaseBuilder.Settings
-
setLazyLoadBatchSize
- Specified by:
setLazyLoadBatchSize
in interfaceDatabaseBuilder
-
setDatabaseSequenceBatchSize
- Specified by:
setDatabaseSequenceBatchSize
in interfaceDatabaseBuilder
-
getJdbcFetchSizeFindList
public int getJdbcFetchSizeFindList()Description copied from interface:DatabaseBuilder.Settings
Return the default JDBC fetchSize hint for findList queries.- Specified by:
getJdbcFetchSizeFindList
in interfaceDatabaseBuilder.Settings
-
setJdbcFetchSizeFindList
- Specified by:
setJdbcFetchSizeFindList
in interfaceDatabaseBuilder
-
getJdbcFetchSizeFindEach
public int getJdbcFetchSizeFindEach()Description copied from interface:DatabaseBuilder.Settings
Return the default JDBC fetchSize hint for findEach/findEachWhile queries.- Specified by:
getJdbcFetchSizeFindEach
in interfaceDatabaseBuilder.Settings
-
setJdbcFetchSizeFindEach
- Specified by:
setJdbcFetchSizeFindEach
in interfaceDatabaseBuilder
-
getChangeLogPrepare
Description copied from interface:DatabaseBuilder.Settings
Return the ChangeLogPrepare.This is used to set user context information to the ChangeSet in the foreground thread prior to the logging occurring in a background thread.
- Specified by:
getChangeLogPrepare
in interfaceDatabaseBuilder.Settings
-
setChangeLogPrepare
- Specified by:
setChangeLogPrepare
in interfaceDatabaseBuilder
-
getChangeLogListener
Description copied from interface:DatabaseBuilder.Settings
Return the ChangeLogListener which actually performs the logging of change sets in the background.- Specified by:
getChangeLogListener
in interfaceDatabaseBuilder.Settings
-
setChangeLogListener
- Specified by:
setChangeLogListener
in interfaceDatabaseBuilder
-
getChangeLogRegister
Description copied from interface:DatabaseBuilder.Settings
Return the ChangeLogRegister which controls which ChangeLogFilter is used for each bean type and in this way provide fine grained control over which persist requests are included in the change log.- Specified by:
getChangeLogRegister
in interfaceDatabaseBuilder.Settings
-
setChangeLogRegister
- Specified by:
setChangeLogRegister
in interfaceDatabaseBuilder
-
isChangeLogIncludeInserts
public boolean isChangeLogIncludeInserts()Description copied from interface:DatabaseBuilder.Settings
Return true if inserts should be included in the change log by default.- Specified by:
isChangeLogIncludeInserts
in interfaceDatabaseBuilder.Settings
-
setChangeLogIncludeInserts
- Specified by:
setChangeLogIncludeInserts
in interfaceDatabaseBuilder
-
isChangeLogAsync
public boolean isChangeLogAsync()Description copied from interface:DatabaseBuilder.Settings
Return true (default) if the changelog should be written async.- Specified by:
isChangeLogAsync
in interfaceDatabaseBuilder.Settings
-
setChangeLogAsync
- Specified by:
setChangeLogAsync
in interfaceDatabaseBuilder
-
getProfilingConfig
Description copied from interface:DatabaseBuilder.Settings
Return the configuration for profiling.- Specified by:
getProfilingConfig
in interfaceDatabaseBuilder.Settings
-
setProfilingConfig
- Specified by:
setProfilingConfig
in interfaceDatabaseBuilder
-
getDbSchema
Description copied from interface:DatabaseBuilder.Settings
Return the DB schema to use.- Specified by:
getDbSchema
in interfaceDatabaseBuilder.Settings
-
setDbSchema
- Specified by:
setDbSchema
in interfaceDatabaseBuilder
-
getGeometrySRID
public int getGeometrySRID()Description copied from interface:DatabaseBuilder.Settings
Return the Geometry SRID.- Specified by:
getGeometrySRID
in interfaceDatabaseBuilder.Settings
-
setGeometrySRID
- Specified by:
setGeometrySRID
in interfaceDatabaseBuilder
-
getDataTimeZone
Description copied from interface:DatabaseBuilder.Settings
Return the time zone to use when reading/writing Timestamps via JDBC.When set a Calendar object is used in JDBC calls when reading/writing Timestamp objects.
- Specified by:
getDataTimeZone
in interfaceDatabaseBuilder.Settings
-
setDataTimeZone
- Specified by:
setDataTimeZone
in interfaceDatabaseBuilder
-
getAsOfViewSuffix
Description copied from interface:DatabaseBuilder.Settings
Return the suffix appended to the base table to derive the view that contains the union of the base table and the history table in order to support asOf queries.- Specified by:
getAsOfViewSuffix
in interfaceDatabaseBuilder.Settings
-
setAsOfViewSuffix
- Specified by:
setAsOfViewSuffix
in interfaceDatabaseBuilder
-
getAsOfSysPeriod
Description copied from interface:DatabaseBuilder.Settings
Return the database column used to support history and 'As of' queries. This column is a timestamp range or equivalent.- Specified by:
getAsOfSysPeriod
in interfaceDatabaseBuilder.Settings
-
setAsOfSysPeriod
- Specified by:
setAsOfSysPeriod
in interfaceDatabaseBuilder
-
getHistoryTableSuffix
Description copied from interface:DatabaseBuilder.Settings
Return the history table suffix (defaults to _history).- Specified by:
getHistoryTableSuffix
in interfaceDatabaseBuilder.Settings
-
setHistoryTableSuffix
- Specified by:
setHistoryTableSuffix
in interfaceDatabaseBuilder
-
isUseJtaTransactionManager
public boolean isUseJtaTransactionManager()Description copied from interface:DatabaseBuilder.Settings
Return true if we are running in a JTA Transaction manager.- Specified by:
isUseJtaTransactionManager
in interfaceDatabaseBuilder.Settings
-
setUseJtaTransactionManager
- Specified by:
setUseJtaTransactionManager
in interfaceDatabaseBuilder
-
getExternalTransactionManager
Description copied from interface:DatabaseBuilder.Settings
Return the external transaction manager.- Specified by:
getExternalTransactionManager
in interfaceDatabaseBuilder.Settings
-
setExternalTransactionManager
public DatabaseConfig setExternalTransactionManager(ExternalTransactionManager externalTransactionManager) - Specified by:
setExternalTransactionManager
in interfaceDatabaseBuilder
-
getServerCachePlugin
Description copied from interface:DatabaseBuilder.Settings
Return the ServerCachePlugin.- Specified by:
getServerCachePlugin
in interfaceDatabaseBuilder.Settings
-
setServerCachePlugin
- Specified by:
setServerCachePlugin
in interfaceDatabaseBuilder
-
isEagerFetchLobs
public boolean isEagerFetchLobs()Description copied from interface:DatabaseBuilder.Settings
Return true if LOB's should default to fetch eager. By default this is set to false and LOB's must be explicitly fetched.- Specified by:
isEagerFetchLobs
in interfaceDatabaseBuilder.Settings
-
setEagerFetchLobs
- Specified by:
setEagerFetchLobs
in interfaceDatabaseBuilder
-
getMaxCallStack
public int getMaxCallStack()Description copied from interface:DatabaseBuilder.Settings
Return the max call stack to use for origin location.- Specified by:
getMaxCallStack
in interfaceDatabaseBuilder.Settings
-
setMaxCallStack
- Specified by:
setMaxCallStack
in interfaceDatabaseBuilder
-
isTransactionRollbackOnChecked
public boolean isTransactionRollbackOnChecked()Description copied from interface:DatabaseBuilder.Settings
Return true if transactions should rollback on checked exceptions.- Specified by:
isTransactionRollbackOnChecked
in interfaceDatabaseBuilder.Settings
-
setTransactionRollbackOnChecked
- Specified by:
setTransactionRollbackOnChecked
in interfaceDatabaseBuilder
-
getBackgroundExecutorSchedulePoolSize
public int getBackgroundExecutorSchedulePoolSize()Description copied from interface:DatabaseBuilder.Settings
Return the Background executor schedule pool size. Defaults to 1.- Specified by:
getBackgroundExecutorSchedulePoolSize
in interfaceDatabaseBuilder.Settings
-
setBackgroundExecutorSchedulePoolSize
- Specified by:
setBackgroundExecutorSchedulePoolSize
in interfaceDatabaseBuilder
-
getBackgroundExecutorShutdownSecs
public int getBackgroundExecutorShutdownSecs()Description copied from interface:DatabaseBuilder.Settings
Return the Background executor shutdown seconds. This is the time allowed for the pool to shutdown nicely before it is forced shutdown.- Specified by:
getBackgroundExecutorShutdownSecs
in interfaceDatabaseBuilder.Settings
-
setBackgroundExecutorShutdownSecs
- Specified by:
setBackgroundExecutorShutdownSecs
in interfaceDatabaseBuilder
-
getBackgroundExecutorWrapper
Description copied from interface:DatabaseBuilder.Settings
Return the background executor wrapper.- Specified by:
getBackgroundExecutorWrapper
in interfaceDatabaseBuilder.Settings
-
setBackgroundExecutorWrapper
public DatabaseConfig setBackgroundExecutorWrapper(BackgroundExecutorWrapper backgroundExecutorWrapper) - Specified by:
setBackgroundExecutorWrapper
in interfaceDatabaseBuilder
-
getCacheMaxSize
public int getCacheMaxSize()Description copied from interface:DatabaseBuilder.Settings
Return the L2 cache default max size.- Specified by:
getCacheMaxSize
in interfaceDatabaseBuilder.Settings
-
setCacheMaxSize
- Specified by:
setCacheMaxSize
in interfaceDatabaseBuilder
-
getCacheMaxIdleTime
public int getCacheMaxIdleTime()Description copied from interface:DatabaseBuilder.Settings
Return the L2 cache default max idle time in seconds.- Specified by:
getCacheMaxIdleTime
in interfaceDatabaseBuilder.Settings
-
setCacheMaxIdleTime
- Specified by:
setCacheMaxIdleTime
in interfaceDatabaseBuilder
-
getCacheMaxTimeToLive
public int getCacheMaxTimeToLive()Description copied from interface:DatabaseBuilder.Settings
Return the L2 cache default max time to live in seconds.- Specified by:
getCacheMaxTimeToLive
in interfaceDatabaseBuilder.Settings
-
setCacheMaxTimeToLive
- Specified by:
setCacheMaxTimeToLive
in interfaceDatabaseBuilder
-
getQueryCacheMaxSize
public int getQueryCacheMaxSize()Description copied from interface:DatabaseBuilder.Settings
Return the L2 query cache default max size.- Specified by:
getQueryCacheMaxSize
in interfaceDatabaseBuilder.Settings
-
setQueryCacheMaxSize
- Specified by:
setQueryCacheMaxSize
in interfaceDatabaseBuilder
-
getQueryCacheMaxIdleTime
public int getQueryCacheMaxIdleTime()Description copied from interface:DatabaseBuilder.Settings
Return the L2 query cache default max idle time in seconds.- Specified by:
getQueryCacheMaxIdleTime
in interfaceDatabaseBuilder.Settings
-
setQueryCacheMaxIdleTime
- Specified by:
setQueryCacheMaxIdleTime
in interfaceDatabaseBuilder
-
getQueryCacheMaxTimeToLive
public int getQueryCacheMaxTimeToLive()Description copied from interface:DatabaseBuilder.Settings
Return the L2 query cache default max time to live in seconds.- Specified by:
getQueryCacheMaxTimeToLive
in interfaceDatabaseBuilder.Settings
-
setQueryCacheMaxTimeToLive
- Specified by:
setQueryCacheMaxTimeToLive
in interfaceDatabaseBuilder
-
getNamingConvention
Description copied from interface:DatabaseBuilder.Settings
Return the NamingConvention.If none has been set the default UnderscoreNamingConvention is used.
- Specified by:
getNamingConvention
in interfaceDatabaseBuilder.Settings
-
setNamingConvention
- Specified by:
setNamingConvention
in interfaceDatabaseBuilder
-
isAllQuotedIdentifiers
public boolean isAllQuotedIdentifiers()Description copied from interface:DatabaseBuilder.Settings
Return true if all DB column and table names should use quoted identifiers.- Specified by:
isAllQuotedIdentifiers
in interfaceDatabaseBuilder.Settings
-
setAllQuotedIdentifiers
- Specified by:
setAllQuotedIdentifiers
in interfaceDatabaseBuilder
-
getConstraintNaming
Description copied from interface:DatabaseBuilder.Settings
Return the constraint naming convention used in DDL generation.- Specified by:
getConstraintNaming
in interfaceDatabaseBuilder.Settings
-
setConstraintNaming
- Specified by:
setConstraintNaming
in interfaceDatabaseBuilder
-
getAutoTuneConfig
Description copied from interface:DatabaseBuilder.Settings
Return the configuration for AutoTune.- Specified by:
getAutoTuneConfig
in interfaceDatabaseBuilder.Settings
-
setAutoTuneConfig
- Specified by:
setAutoTuneConfig
in interfaceDatabaseBuilder
-
skipDataSourceCheck
public boolean skipDataSourceCheck()Description copied from interface:DatabaseBuilder.Settings
Return true if the startup DataSource check should be skipped.- Specified by:
skipDataSourceCheck
in interfaceDatabaseBuilder.Settings
-
setSkipDataSourceCheck
- Specified by:
setSkipDataSourceCheck
in interfaceDatabaseBuilder
-
readOnlyDatabase
Description copied from interface:DatabaseBuilder
Set to true if this database is used in a read only way.The DataSource and read-only DataSource are expected to be the same and use readOnly=true and autoCommit=true.
- Specified by:
readOnlyDatabase
in interfaceDatabaseBuilder
-
readOnlyDatabase
public boolean readOnlyDatabase()Description copied from interface:DatabaseBuilder.Settings
Return true if this database is used in a read only way.The DataSource and read-only DataSource are expected to be the same and use readOnly=true and autoCommit=true.
- Specified by:
readOnlyDatabase
in interfaceDatabaseBuilder.Settings
-
getDataSource
Description copied from interface:DatabaseBuilder.Settings
Return the DataSource.- Specified by:
getDataSource
in interfaceDatabaseBuilder.Settings
-
setDataSource
- Specified by:
setDataSource
in interfaceDatabaseBuilder
-
getReadOnlyDataSource
Description copied from interface:DatabaseBuilder.Settings
Return the read only DataSource.- Specified by:
getReadOnlyDataSource
in interfaceDatabaseBuilder.Settings
-
setReadOnlyDataSource
- Specified by:
setReadOnlyDataSource
in interfaceDatabaseBuilder
-
getDataSourceConfig
public io.ebean.datasource.DataSourceBuilder.Settings getDataSourceConfig()Description copied from interface:DatabaseBuilder.Settings
Return the configuration to build a DataSource using Ebean's own DataSource implementation.- Specified by:
getDataSourceConfig
in interfaceDatabaseBuilder.Settings
-
setDataSourceConfig
- Specified by:
setDataSourceConfig
in interfaceDatabaseBuilder
-
isAutoReadOnlyDataSource
public boolean isAutoReadOnlyDataSource()Description copied from interface:DatabaseBuilder.Settings
Return true if Ebean should create a DataSource for use with implicit read only transactions.- Specified by:
isAutoReadOnlyDataSource
in interfaceDatabaseBuilder.Settings
-
setAutoReadOnlyDataSource
- Specified by:
setAutoReadOnlyDataSource
in interfaceDatabaseBuilder
-
getReadOnlyDataSourceConfig
public io.ebean.datasource.DataSourceBuilder.Settings getReadOnlyDataSourceConfig()Description copied from interface:DatabaseBuilder.Settings
Return the configuration for the read only DataSource.This is only used if autoReadOnlyDataSource is true.
The driver, url, username and password default to the configuration for the main DataSource if they are not set on this configuration. This means there is actually no need to set any configuration here and we only set configuration for url, username and password etc if it is different from the main DataSource.
- Specified by:
getReadOnlyDataSourceConfig
in interfaceDatabaseBuilder.Settings
-
setReadOnlyDataSourceConfig
- Specified by:
setReadOnlyDataSourceConfig
in interfaceDatabaseBuilder
-
getDatabaseBooleanTrue
Description copied from interface:DatabaseBuilder.Settings
Return a value used to represent TRUE in the database.This is used for databases that do not support boolean natively.
The value returned is either a Integer or a String (e.g. "1", or "T").
- Specified by:
getDatabaseBooleanTrue
in interfaceDatabaseBuilder.Settings
-
setDatabaseBooleanTrue
- Specified by:
setDatabaseBooleanTrue
in interfaceDatabaseBuilder
-
getDatabaseBooleanFalse
Description copied from interface:DatabaseBuilder.Settings
Return a value used to represent FALSE in the database.This is used for databases that do not support boolean natively.
The value returned is either a Integer or a String (e.g. "0", or "F").
- Specified by:
getDatabaseBooleanFalse
in interfaceDatabaseBuilder.Settings
-
setDatabaseBooleanFalse
- Specified by:
setDatabaseBooleanFalse
in interfaceDatabaseBuilder
-
getDatabaseSequenceBatchSize
public int getDatabaseSequenceBatchSize()Description copied from interface:DatabaseBuilder.Settings
Return the number of DB sequence values that should be preallocated.- Specified by:
getDatabaseSequenceBatchSize
in interfaceDatabaseBuilder.Settings
-
setDatabaseSequenceBatch
- Specified by:
setDatabaseSequenceBatch
in interfaceDatabaseBuilder
-
getDatabasePlatformName
Description copied from interface:DatabaseBuilder.Settings
Return the database platform name (can be null).If null then the platform is determined automatically via the JDBC driver information.
- Specified by:
getDatabasePlatformName
in interfaceDatabaseBuilder.Settings
-
setDatabasePlatformName
- Specified by:
setDatabasePlatformName
in interfaceDatabaseBuilder
-
getDatabasePlatform
Description copied from interface:DatabaseBuilder.Settings
Return the database platform to use for this database.- Specified by:
getDatabasePlatform
in interfaceDatabaseBuilder.Settings
-
setDatabasePlatform
- Specified by:
setDatabasePlatform
in interfaceDatabaseBuilder
-
getIdType
Description copied from interface:DatabaseBuilder.Settings
Return the preferred DB platform IdType.- Specified by:
getIdType
in interfaceDatabaseBuilder.Settings
-
setIdType
- Specified by:
setIdType
in interfaceDatabaseBuilder
-
getEncryptKeyManager
Description copied from interface:DatabaseBuilder.Settings
Return the EncryptKeyManager.- Specified by:
getEncryptKeyManager
in interfaceDatabaseBuilder.Settings
-
setEncryptKeyManager
- Specified by:
setEncryptKeyManager
in interfaceDatabaseBuilder
-
getEncryptDeployManager
Description copied from interface:DatabaseBuilder.Settings
Return the EncryptDeployManager.This is optionally used to programmatically define which columns are encrypted instead of using the
Encrypted
Annotation.- Specified by:
getEncryptDeployManager
in interfaceDatabaseBuilder.Settings
-
setEncryptDeployManager
- Specified by:
setEncryptDeployManager
in interfaceDatabaseBuilder
-
getEncryptor
Description copied from interface:DatabaseBuilder.Settings
Return the Encryptor used to encrypt data on the java client side (as opposed to DB encryption functions).- Specified by:
getEncryptor
in interfaceDatabaseBuilder.Settings
-
setEncryptor
- Specified by:
setEncryptor
in interfaceDatabaseBuilder
-
isDbOffline
public boolean isDbOffline()Description copied from interface:DatabaseBuilder.Settings
Return true if the Database instance should be created in offline mode.- Specified by:
isDbOffline
in interfaceDatabaseBuilder.Settings
-
setDbOffline
- Specified by:
setDbOffline
in interfaceDatabaseBuilder
-
getDbEncrypt
Description copied from interface:DatabaseBuilder.Settings
Return the DbEncrypt used to encrypt and decrypt properties.Note that if this is not set then the DbPlatform may already have a DbEncrypt set and that will be used.
- Specified by:
getDbEncrypt
in interfaceDatabaseBuilder.Settings
-
setDbEncrypt
- Specified by:
setDbEncrypt
in interfaceDatabaseBuilder
-
getPlatformConfig
Description copied from interface:DatabaseBuilder.Settings
Return the configuration for DB types (such as UUID and custom mappings).- Specified by:
getPlatformConfig
in interfaceDatabaseBuilder.Settings
-
setPlatformConfig
- Specified by:
setPlatformConfig
in interfaceDatabaseBuilder
-
setDbUuid
- Specified by:
setDbUuid
in interfaceDatabaseBuilder
-
getUuidVersion
Description copied from interface:DatabaseBuilder.Settings
Returns the UUID version mode.- Specified by:
getUuidVersion
in interfaceDatabaseBuilder.Settings
-
setUuidVersion
- Specified by:
setUuidVersion
in interfaceDatabaseBuilder
-
getUuidStateFile
Description copied from interface:DatabaseBuilder.Settings
Return the UUID state file.- Specified by:
getUuidStateFile
in interfaceDatabaseBuilder.Settings
-
setUuidStateFile
- Specified by:
setUuidStateFile
in interfaceDatabaseBuilder
-
getUuidNodeId
Description copied from interface:DatabaseBuilder.Settings
Returns the V1-UUID-NodeId- Specified by:
getUuidNodeId
in interfaceDatabaseBuilder.Settings
-
setUuidNodeId
- Specified by:
setUuidNodeId
in interfaceDatabaseBuilder
-
isLocalTimeWithNanos
public boolean isLocalTimeWithNanos()Description copied from interface:DatabaseBuilder.Settings
Return true if LocalTime should be persisted with nanos precision.- Specified by:
isLocalTimeWithNanos
in interfaceDatabaseBuilder.Settings
-
setLocalTimeWithNanos
- Specified by:
setLocalTimeWithNanos
in interfaceDatabaseBuilder
-
isDurationWithNanos
public boolean isDurationWithNanos()Description copied from interface:DatabaseBuilder.Settings
Return true if Duration should be persisted with nanos precision (SQL DECIMAL).Otherwise it is persisted with second precision (SQL INTEGER).
- Specified by:
isDurationWithNanos
in interfaceDatabaseBuilder.Settings
-
setDurationWithNanos
- Specified by:
setDurationWithNanos
in interfaceDatabaseBuilder
-
setRunMigration
- Specified by:
setRunMigration
in interfaceDatabaseBuilder
-
isRunMigration
public boolean isRunMigration()Description copied from interface:DatabaseBuilder.Settings
Return true if the DB migration should run on server start.- Specified by:
isRunMigration
in interfaceDatabaseBuilder.Settings
-
setDdlGenerate
- Specified by:
setDdlGenerate
in interfaceDatabaseBuilder
-
setDdlRun
- Specified by:
setDdlRun
in interfaceDatabaseBuilder
-
setDdlExtra
- Specified by:
setDdlExtra
in interfaceDatabaseBuilder
-
isDdlCreateOnly
public boolean isDdlCreateOnly()Description copied from interface:DatabaseBuilder.Settings
Return true if the "drop all ddl" should be skipped.Typically we want to do this when using H2 (in memory) as our test database and the drop statements are not required so skipping the drop table statements etc makes it faster with less noise in the logs.
- Specified by:
isDdlCreateOnly
in interfaceDatabaseBuilder.Settings
-
setDdlCreateOnly
- Specified by:
setDdlCreateOnly
in interfaceDatabaseBuilder
-
getDdlSeedSql
Description copied from interface:DatabaseBuilder.Settings
Return SQL script to execute after the "create all" DDL has been run.Typically this is a sql script that inserts test seed data when running tests. Place a sql script in src/test/resources that inserts test seed data.
- Specified by:
getDdlSeedSql
in interfaceDatabaseBuilder.Settings
-
setDdlSeedSql
- Specified by:
setDdlSeedSql
in interfaceDatabaseBuilder
-
getDdlInitSql
Description copied from interface:DatabaseBuilder.Settings
Return a SQL script to execute before the "create all" DDL has been run.- Specified by:
getDdlInitSql
in interfaceDatabaseBuilder.Settings
-
setDdlInitSql
- Specified by:
setDdlInitSql
in interfaceDatabaseBuilder
-
isDdlGenerate
public boolean isDdlGenerate()Description copied from interface:DatabaseBuilder.Settings
Return true if the DDL should be generated.- Specified by:
isDdlGenerate
in interfaceDatabaseBuilder.Settings
-
isDdlRun
public boolean isDdlRun()Description copied from interface:DatabaseBuilder.Settings
Return true if the DDL should be run.- Specified by:
isDdlRun
in interfaceDatabaseBuilder.Settings
-
isDdlExtra
public boolean isDdlExtra()Description copied from interface:DatabaseBuilder.Settings
Return true, if extra-ddl.xml should be executed.- Specified by:
isDdlExtra
in interfaceDatabaseBuilder.Settings
-
setDdlHeader
- Specified by:
setDdlHeader
in interfaceDatabaseBuilder
-
getDdlHeader
Description copied from interface:DatabaseBuilder.Settings
Return the header to use with DDL generation.- Specified by:
getDdlHeader
in interfaceDatabaseBuilder.Settings
-
isDdlStrictMode
public boolean isDdlStrictMode()Description copied from interface:DatabaseBuilder.Settings
Return true if strict mode is used which includes a check that non-null columns have a default value.- Specified by:
isDdlStrictMode
in interfaceDatabaseBuilder.Settings
-
setDdlStrictMode
- Specified by:
setDdlStrictMode
in interfaceDatabaseBuilder
-
getDdlPlaceholders
Description copied from interface:DatabaseBuilder.Settings
Return a comma and equals delimited placeholders that are substituted in DDL scripts.- Specified by:
getDdlPlaceholders
in interfaceDatabaseBuilder.Settings
-
setDdlPlaceholders
- Specified by:
setDdlPlaceholders
in interfaceDatabaseBuilder
-
getDdlPlaceholderMap
Description copied from interface:DatabaseBuilder.Settings
Return a map of placeholder values that are substituted in DDL scripts.- Specified by:
getDdlPlaceholderMap
in interfaceDatabaseBuilder.Settings
-
setDdlPlaceholderMap
- Specified by:
setDdlPlaceholderMap
in interfaceDatabaseBuilder
-
isDisableClasspathSearch
public boolean isDisableClasspathSearch()Description copied from interface:DatabaseBuilder.Settings
Return true if the class path search should be disabled.- Specified by:
isDisableClasspathSearch
in interfaceDatabaseBuilder.Settings
-
setDisableClasspathSearch
- Specified by:
setDisableClasspathSearch
in interfaceDatabaseBuilder
-
getJodaLocalTimeMode
Description copied from interface:DatabaseBuilder.Settings
Return the mode to use for Joda LocalTime support 'normal' or 'utc'.- Specified by:
getJodaLocalTimeMode
in interfaceDatabaseBuilder.Settings
-
setJodaLocalTimeMode
- Specified by:
setJodaLocalTimeMode
in interfaceDatabaseBuilder
-
addClass
Description copied from interface:DatabaseBuilder
Programmatically add classes (typically entities) that this server should use.The class can be an Entity, Embedded type, ScalarType, BeanPersistListener, BeanFinder or BeanPersistController.
If no classes are specified then the classes are found automatically via searching the class path.
- Specified by:
addClass
in interfaceDatabaseBuilder
- Parameters:
cls
- the entity type (or other type) that should be registered by this database.
-
addAll
Description copied from interface:DatabaseBuilder
Register all the classes (typically entity classes).- Specified by:
addAll
in interfaceDatabaseBuilder
-
addPackage
Description copied from interface:DatabaseBuilder
Add a package to search for entities via class path search.This is only used if classes have not been explicitly specified.
- Specified by:
addPackage
in interfaceDatabaseBuilder
-
getPackages
Description copied from interface:DatabaseBuilder.Settings
Return packages to search for entities via class path search.This is only used if classes have not been explicitly specified.
- Specified by:
getPackages
in interfaceDatabaseBuilder.Settings
-
setPackages
Description copied from interface:DatabaseBuilder
Set packages to search for entities via class path search.This is only used if classes have not been explicitly specified.
- Specified by:
setPackages
in interfaceDatabaseBuilder
-
setClasses
Set the list of classes (entities, listeners, scalarTypes etc) that should be used for this database.Leaving void for spring xml wiring for now.
-
classes
Description copied from interface:DatabaseBuilder
Set the list of classes (entities, listeners, scalarTypes etc) that should be used for this database.If no classes are specified then the classes are found automatically via searching the class path.
Alternatively the classes can contain added via
DatabaseBuilder.addClass(Class)
.- Specified by:
classes
in interfaceDatabaseBuilder
-
classes
Description copied from interface:DatabaseBuilder.Settings
Return the classes registered for this database. Typically, this includes entities and perhaps listeners.- Specified by:
classes
in interfaceDatabaseBuilder.Settings
-
getClasses
Deprecated, for removal: This API element is subject to removal in a future version.- migrate toclasses()
.- Specified by:
getClasses
in interfaceDatabaseBuilder.Settings
-
isSkipCacheAfterWrite
public boolean isSkipCacheAfterWrite()Description copied from interface:DatabaseBuilder.Settings
Return true if L2 bean cache should be skipped once writes have occurred on a transaction.This defaults to true and means that for "find by id" and "find by natural key" queries that normally hit L2 bean cache automatically will not do so after a write/persist on the transaction.
// assume Customer has L2 bean caching enabled ... try (Transaction transaction = DB.beginTransaction()) { // this uses L2 bean cache as the transaction // ... is considered "query only" at this point Customer.find.byId(42); // transaction no longer "query only" once // ... a bean has been saved etc DB.save(someBean); // will NOT use L2 bean cache as the transaction // ... is no longer considered "query only" Customer.find.byId(55); // explicit control - please use L2 bean cache transaction.setSkipCache(false); Customer.find.byId(77); // hit the l2 bean cache // explicit control - please don't use L2 bean cache transaction.setSkipCache(true); Customer.find.byId(99); // skips l2 bean cache }
- Specified by:
isSkipCacheAfterWrite
in interfaceDatabaseBuilder.Settings
- See Also:
-
setSkipCacheAfterWrite
- Specified by:
setSkipCacheAfterWrite
in interfaceDatabaseBuilder
-
isUpdateAllPropertiesInBatch
public boolean isUpdateAllPropertiesInBatch()Description copied from interface:DatabaseBuilder.Settings
Returns true if updates in JDBC batch default to include all properties by default.- Specified by:
isUpdateAllPropertiesInBatch
in interfaceDatabaseBuilder.Settings
-
setUpdateAllPropertiesInBatch
- Specified by:
setUpdateAllPropertiesInBatch
in interfaceDatabaseBuilder
-
getResourceDirectory
Description copied from interface:DatabaseBuilder.Settings
Returns the resource directory.- Specified by:
getResourceDirectory
in interfaceDatabaseBuilder.Settings
-
setResourceDirectory
- Specified by:
setResourceDirectory
in interfaceDatabaseBuilder
-
addCustomMapping
public DatabaseConfig addCustomMapping(DbType type, String columnDefinition, io.ebean.annotation.Platform platform) Description copied from interface:DatabaseBuilder
Add a custom type mapping.// set the default mapping for BigDecimal.class/decimal config.addCustomMapping(DbType.DECIMAL, "decimal(18,6)"); // set the default mapping for String.class/varchar but only for Postgres config.addCustomMapping(DbType.VARCHAR, "text", Platform.POSTGRES);
- Specified by:
addCustomMapping
in interfaceDatabaseBuilder
- Parameters:
type
- The DB type this mapping should apply tocolumnDefinition
- The column definition that should be usedplatform
- Optionally specify the platform this mapping should apply to.
-
addCustomMapping
Description copied from interface:DatabaseBuilder
Add a custom type mapping that applies to all platforms.// set the default mapping for BigDecimal/decimal config.addCustomMapping(DbType.DECIMAL, "decimal(18,6)"); // set the default mapping for String/varchar config.addCustomMapping(DbType.VARCHAR, "text");
- Specified by:
addCustomMapping
in interfaceDatabaseBuilder
- Parameters:
type
- The DB type this mapping should apply tocolumnDefinition
- The column definition that should be used
-
add
Description copied from interface:DatabaseBuilder
Register a BeanQueryAdapter instance.Note alternatively you can use
DatabaseBuilder.setQueryAdapters(List)
to set all the BeanQueryAdapter instances.- Specified by:
add
in interfaceDatabaseBuilder
-
getQueryAdapters
Description copied from interface:DatabaseBuilder.Settings
Return the BeanQueryAdapter instances.- Specified by:
getQueryAdapters
in interfaceDatabaseBuilder.Settings
-
setQueryAdapters
Description copied from interface:DatabaseBuilder
Register all the BeanQueryAdapter instances.Note alternatively you can use
DatabaseBuilder.add(BeanQueryAdapter)
to add BeanQueryAdapter instances one at a time.- Specified by:
setQueryAdapters
in interfaceDatabaseBuilder
-
getIdGenerators
Description copied from interface:DatabaseBuilder.Settings
Return the custom IdGenerator instances.- Specified by:
getIdGenerators
in interfaceDatabaseBuilder.Settings
-
setIdGenerators
Description copied from interface:DatabaseBuilder
Set the custom IdGenerator instances.- Specified by:
setIdGenerators
in interfaceDatabaseBuilder
-
add
Description copied from interface:DatabaseBuilder
Register a customer IdGenerator instance.- Specified by:
add
in interfaceDatabaseBuilder
-
add
Description copied from interface:DatabaseBuilder
Register a BeanPersistController instance.Note alternatively you can use
DatabaseBuilder.setPersistControllers(List)
to set all the BeanPersistController instances.- Specified by:
add
in interfaceDatabaseBuilder
-
add
Description copied from interface:DatabaseBuilder
Register a BeanPostLoad instance.Note alternatively you can use
DatabaseBuilder.setPostLoaders(List)
to set all the BeanPostLoad instances.- Specified by:
add
in interfaceDatabaseBuilder
-
add
Description copied from interface:DatabaseBuilder
Register a BeanPostConstructListener instance.Note alternatively you can use
DatabaseBuilder.setPostConstructListeners(List)
to set all the BeanPostConstructListener instances.- Specified by:
add
in interfaceDatabaseBuilder
-
getFindControllers
Description copied from interface:DatabaseBuilder.Settings
Return the list of BeanFindController instances.- Specified by:
getFindControllers
in interfaceDatabaseBuilder.Settings
-
setFindControllers
Description copied from interface:DatabaseBuilder
Set the list of BeanFindController instances.- Specified by:
setFindControllers
in interfaceDatabaseBuilder
-
getPostLoaders
Description copied from interface:DatabaseBuilder.Settings
Return the list of BeanPostLoader instances.- Specified by:
getPostLoaders
in interfaceDatabaseBuilder.Settings
-
setPostLoaders
Description copied from interface:DatabaseBuilder
Set the list of BeanPostLoader instances.- Specified by:
setPostLoaders
in interfaceDatabaseBuilder
-
getPostConstructListeners
Description copied from interface:DatabaseBuilder.Settings
Return the list of BeanPostLoader instances.- Specified by:
getPostConstructListeners
in interfaceDatabaseBuilder.Settings
-
setPostConstructListeners
Description copied from interface:DatabaseBuilder
Set the list of BeanPostLoader instances.- Specified by:
setPostConstructListeners
in interfaceDatabaseBuilder
-
getPersistControllers
Description copied from interface:DatabaseBuilder.Settings
Return the BeanPersistController instances.- Specified by:
getPersistControllers
in interfaceDatabaseBuilder.Settings
-
setPersistControllers
Description copied from interface:DatabaseBuilder
Register all the BeanPersistController instances.Note alternatively you can use
DatabaseBuilder.add(BeanPersistController)
to add BeanPersistController instances one at a time.- Specified by:
setPersistControllers
in interfaceDatabaseBuilder
-
add
Description copied from interface:DatabaseBuilder
Register a BeanPersistListener instance.Note alternatively you can use
DatabaseBuilder.setPersistListeners(List)
to set all the BeanPersistListener instances.- Specified by:
add
in interfaceDatabaseBuilder
-
getPersistListeners
Description copied from interface:DatabaseBuilder.Settings
Return the BeanPersistListener instances.- Specified by:
getPersistListeners
in interfaceDatabaseBuilder.Settings
-
add
Description copied from interface:DatabaseBuilder
Add a BulkTableEventListener- Specified by:
add
in interfaceDatabaseBuilder
-
getBulkTableEventListeners
Description copied from interface:DatabaseBuilder.Settings
Return the list of BulkTableEventListener instances.- Specified by:
getBulkTableEventListeners
in interfaceDatabaseBuilder.Settings
-
addServerConfigStartup
Description copied from interface:DatabaseBuilder
Add a ServerConfigStartup.- Specified by:
addServerConfigStartup
in interfaceDatabaseBuilder
-
getServerConfigStartupListeners
Description copied from interface:DatabaseBuilder.Settings
Return the list of ServerConfigStartup instances.- Specified by:
getServerConfigStartupListeners
in interfaceDatabaseBuilder.Settings
-
setPersistListeners
Description copied from interface:DatabaseBuilder
Register all the BeanPersistListener instances.Note alternatively you can use
DatabaseBuilder.add(BeanPersistListener)
to add BeanPersistListener instances one at a time.- Specified by:
setPersistListeners
in interfaceDatabaseBuilder
-
getPersistenceContextScope
Description copied from interface:DatabaseBuilder.Settings
Return the default PersistenceContextScope to be used if one is not explicitly set on a query. The PersistenceContextScope can specified on each query via.Query#setPersistenceContextScope(io.ebean.PersistenceContextScope)
. If it is not set on the query this default scope is used.- Specified by:
getPersistenceContextScope
in interfaceDatabaseBuilder.Settings
- See Also:
-
setPersistenceContextScope
- Specified by:
setPersistenceContextScope
in interfaceDatabaseBuilder
-
getClassLoadConfig
Description copied from interface:DatabaseBuilder.Settings
Return the ClassLoadConfig which is used to detect Joda, Java8 types etc and also create new instances of plugins given a className.- Specified by:
getClassLoadConfig
in interfaceDatabaseBuilder.Settings
-
setClassLoadConfig
- Specified by:
setClassLoadConfig
in interfaceDatabaseBuilder
-
loadFromProperties
Description copied from interface:DatabaseBuilder
Load settings from application.properties, application.yaml and other sources.Uses
avaje-config
to load configuration properties. Goto https://avaje.io/config for detail on how and where properties are loaded from.- Specified by:
loadFromProperties
in interfaceDatabaseBuilder
-
loadFromProperties
Description copied from interface:DatabaseBuilder
Load the settings from the given properties- Specified by:
loadFromProperties
in interfaceDatabaseBuilder
-
getProperties
Description copied from interface:DatabaseBuilder.Settings
Return the properties that we used for configuration and were set via a call to loadFromProperties().- Specified by:
getProperties
in interfaceDatabaseBuilder.Settings
-
loadDataSourceSettings
loads the data source settings to preserve existing behaviour. IMHO, if someone has set the datasource config already, they don't want the settings to be reloaded and reset. This allows a descending class to override this behaviour and prevent it from happening.- Parameters:
p
- - The defined property source passed to load settings
-
loadAutoTuneSettings
This is broken out to allow overridden behaviour. -
loadSettings
Load the configuration settings from the properties file. -
appliedPersistBatchOnCascade
public io.ebean.annotation.PersistBatch appliedPersistBatchOnCascade()Description copied from interface:DatabaseBuilder.Settings
Return the PersistBatch mode to use for 'batchOnCascade' taking into account if the database platform supports getGeneratedKeys in batch mode.- Specified by:
appliedPersistBatchOnCascade
in interfaceDatabaseBuilder.Settings
-
getObjectMapper
Description copied from interface:DatabaseBuilder.Settings
Return the Jackson ObjectMapper.Note that this is not strongly typed as Jackson ObjectMapper is an optional dependency.
- Specified by:
getObjectMapper
in interfaceDatabaseBuilder.Settings
-
setObjectMapper
- Specified by:
setObjectMapper
in interfaceDatabaseBuilder
-
isExpressionEqualsWithNullAsNoop
public boolean isExpressionEqualsWithNullAsNoop()Description copied from interface:DatabaseBuilder.Settings
Return true if eq("someProperty", null) should to generate "1=1" rather than "is null" sql expression.- Specified by:
isExpressionEqualsWithNullAsNoop
in interfaceDatabaseBuilder.Settings
-
setExpressionEqualsWithNullAsNoop
- Specified by:
setExpressionEqualsWithNullAsNoop
in interfaceDatabaseBuilder
-
isExpressionNativeIlike
public boolean isExpressionNativeIlike()Description copied from interface:DatabaseBuilder.Settings
Return true if native ILIKE expression should be used if supported by the database platform (e.g. Postgres).- Specified by:
isExpressionNativeIlike
in interfaceDatabaseBuilder.Settings
-
setExpressionNativeIlike
- Specified by:
setExpressionNativeIlike
in interfaceDatabaseBuilder
-
getEnabledL2Regions
Description copied from interface:DatabaseBuilder.Settings
Return the enabled L2 cache regions.- Specified by:
getEnabledL2Regions
in interfaceDatabaseBuilder.Settings
-
setEnabledL2Regions
- Specified by:
setEnabledL2Regions
in interfaceDatabaseBuilder
-
isDisableL2Cache
public boolean isDisableL2Cache()Description copied from interface:DatabaseBuilder.Settings
Return true if L2 cache is disabled.- Specified by:
isDisableL2Cache
in interfaceDatabaseBuilder.Settings
-
setDisableL2Cache
- Specified by:
setDisableL2Cache
in interfaceDatabaseBuilder
-
isLocalOnlyL2Cache
public boolean isLocalOnlyL2Cache()Description copied from interface:DatabaseBuilder.Settings
Return true to use local only L2 cache. Effectively ignore l2 cache plugin like ebean-redis etc.- Specified by:
isLocalOnlyL2Cache
in interfaceDatabaseBuilder.Settings
-
setLocalOnlyL2Cache
- Specified by:
setLocalOnlyL2Cache
in interfaceDatabaseBuilder
-
isUseValidationNotNull
public boolean isUseValidationNotNull()Description copied from interface:DatabaseBuilder.Settings
Returns if we use javax.validation.constraints.NotNull- Specified by:
isUseValidationNotNull
in interfaceDatabaseBuilder.Settings
-
setUseValidationNotNull
- Specified by:
setUseValidationNotNull
in interfaceDatabaseBuilder
-
isNotifyL2CacheInForeground
public boolean isNotifyL2CacheInForeground()Description copied from interface:DatabaseBuilder.Settings
Return true if L2 cache notification should run in the foreground.- Specified by:
isNotifyL2CacheInForeground
in interfaceDatabaseBuilder.Settings
-
setNotifyL2CacheInForeground
- Specified by:
setNotifyL2CacheInForeground
in interfaceDatabaseBuilder
-
getQueryPlanTTLSeconds
public int getQueryPlanTTLSeconds()Description copied from interface:DatabaseBuilder.Settings
Return the time to live for ebean's internal query plan.- Specified by:
getQueryPlanTTLSeconds
in interfaceDatabaseBuilder.Settings
-
setQueryPlanTTLSeconds
- Specified by:
setQueryPlanTTLSeconds
in interfaceDatabaseBuilder
-
newPlatformConfig
Description copied from interface:DatabaseBuilder
Create a new PlatformConfig based of the one held but with overridden properties by reading properties with the given path and prefix.Typically used in Db Migration generation for many platform targets that might have different configuration for IdType, UUID, quoted identifiers etc.
- Specified by:
newPlatformConfig
in interfaceDatabaseBuilder
- Parameters:
propertiesPath
- The properties path used for loading and setting propertiesplatformPrefix
- The prefix used for loading and setting properties- Returns:
- A copy of the PlatformConfig with overridden properties
-
addMappingLocation
Description copied from interface:DatabaseBuilder
Add a mapping location to search for xml mapping via class path search.- Specified by:
addMappingLocation
in interfaceDatabaseBuilder
-
getMappingLocations
Description copied from interface:DatabaseBuilder.Settings
Return mapping locations to search for xml mapping via class path search.- Specified by:
getMappingLocations
in interfaceDatabaseBuilder.Settings
-
setMappingLocations
- Specified by:
setMappingLocations
in interfaceDatabaseBuilder
-
isIdGeneratorAutomatic
public boolean isIdGeneratorAutomatic()Description copied from interface:DatabaseBuilder.Settings
When false we need explicit@GeneratedValue
mapping to assign Identity or Sequence generated values. When true Id properties are automatically assigned Identity or Sequence without the GeneratedValue mapping.- Specified by:
isIdGeneratorAutomatic
in interfaceDatabaseBuilder.Settings
-
setIdGeneratorAutomatic
- Specified by:
setIdGeneratorAutomatic
in interfaceDatabaseBuilder
-
isQueryPlanEnable
public boolean isQueryPlanEnable()Description copied from interface:DatabaseBuilder.Settings
Return true if query plan capture is enabled.- Specified by:
isQueryPlanEnable
in interfaceDatabaseBuilder.Settings
-
setQueryPlanEnable
- Specified by:
setQueryPlanEnable
in interfaceDatabaseBuilder
-
getQueryPlanThresholdMicros
public long getQueryPlanThresholdMicros()Description copied from interface:DatabaseBuilder.Settings
Return the query plan collection threshold in microseconds.- Specified by:
getQueryPlanThresholdMicros
in interfaceDatabaseBuilder.Settings
-
setQueryPlanThresholdMicros
- Specified by:
setQueryPlanThresholdMicros
in interfaceDatabaseBuilder
-
isQueryPlanCapture
public boolean isQueryPlanCapture()Description copied from interface:DatabaseBuilder.Settings
Return true if periodic capture of query plans is enabled.- Specified by:
isQueryPlanCapture
in interfaceDatabaseBuilder.Settings
-
setQueryPlanCapture
- Specified by:
setQueryPlanCapture
in interfaceDatabaseBuilder
-
getQueryPlanCapturePeriodSecs
public long getQueryPlanCapturePeriodSecs()Description copied from interface:DatabaseBuilder.Settings
Return the frequency to capture query plans.- Specified by:
getQueryPlanCapturePeriodSecs
in interfaceDatabaseBuilder.Settings
-
setQueryPlanCapturePeriodSecs
- Specified by:
setQueryPlanCapturePeriodSecs
in interfaceDatabaseBuilder
-
getQueryPlanCaptureMaxTimeMillis
public long getQueryPlanCaptureMaxTimeMillis()Description copied from interface:DatabaseBuilder.Settings
Return the time after which a capture query plans request will stop capturing more query plans.Effectively this controls the amount of load/time we want to allow for query plan capture.
- Specified by:
getQueryPlanCaptureMaxTimeMillis
in interfaceDatabaseBuilder.Settings
-
setQueryPlanCaptureMaxTimeMillis
- Specified by:
setQueryPlanCaptureMaxTimeMillis
in interfaceDatabaseBuilder
-
getQueryPlanCaptureMaxCount
public int getQueryPlanCaptureMaxCount()Description copied from interface:DatabaseBuilder.Settings
Return the max number of query plans captured per request.- Specified by:
getQueryPlanCaptureMaxCount
in interfaceDatabaseBuilder.Settings
-
setQueryPlanCaptureMaxCount
- Specified by:
setQueryPlanCaptureMaxCount
in interfaceDatabaseBuilder
-
getQueryPlanListener
Description copied from interface:DatabaseBuilder.Settings
Return the listener used to process captured query plans.- Specified by:
getQueryPlanListener
in interfaceDatabaseBuilder.Settings
-
setQueryPlanListener
- Specified by:
setQueryPlanListener
in interfaceDatabaseBuilder
-
isDumpMetricsOnShutdown
public boolean isDumpMetricsOnShutdown()Description copied from interface:DatabaseBuilder.Settings
Return true if metrics should be dumped when the server is shutdown.- Specified by:
isDumpMetricsOnShutdown
in interfaceDatabaseBuilder.Settings
-
setDumpMetricsOnShutdown
- Specified by:
setDumpMetricsOnShutdown
in interfaceDatabaseBuilder
-
getDumpMetricsOptions
Description copied from interface:DatabaseBuilder.Settings
Return the options for dumping metrics.- Specified by:
getDumpMetricsOptions
in interfaceDatabaseBuilder.Settings
-
setDumpMetricsOptions
- Specified by:
setDumpMetricsOptions
in interfaceDatabaseBuilder
-
isLoadModuleInfo
public boolean isLoadModuleInfo()Description copied from interface:DatabaseBuilder.Settings
Return true if entity classes should be loaded and registered via EntityClassRegister.When false we either register entity classes via application code or use classpath scanning to find and register entity classes.
- Specified by:
isLoadModuleInfo
in interfaceDatabaseBuilder.Settings
-
isIncludeLabelInSql
public boolean isIncludeLabelInSql()Description copied from interface:DatabaseBuilder.Settings
Return true if generated sql select query should include an inline sql comment with the query label or profile location label.- Specified by:
isIncludeLabelInSql
in interfaceDatabaseBuilder.Settings
-
isAutoLoadModuleInfo
Deprecated, for removal: This API element is subject to removal in a future version.- migrate toisLoadModuleInfo()
.- Specified by:
isAutoLoadModuleInfo
in interfaceDatabaseBuilder.Settings
-
setLoadModuleInfo
- Specified by:
setLoadModuleInfo
in interfaceDatabaseBuilder
-
includeLabelInSql
Description copied from interface:DatabaseBuilder
Set if generated SQL SELECT should include the query label as an inline SQL comment (to help reference back from the SQL to the code that executed the query.- Specified by:
includeLabelInSql
in interfaceDatabaseBuilder
- Parameters:
includeLabelInSql
- When true include a SQL inline comment in generated SELECT queries.
-
getMetricNaming
Description copied from interface:DatabaseBuilder.Settings
Return the naming convention to apply to metrics names.- Specified by:
getMetricNaming
in interfaceDatabaseBuilder.Settings
-
setMetricNaming
- Specified by:
setMetricNaming
in interfaceDatabaseBuilder
-
getLengthCheck
Returns the length check mode.- Specified by:
getLengthCheck
in interfaceDatabaseBuilder.Settings
-
lengthCheck
Description copied from interface:DatabaseBuilder
Sets the length check mode.- Specified by:
lengthCheck
in interfaceDatabaseBuilder
-
classes()
.