- 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.PersistBatchReturn 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.intReturn the Background executor schedule pool size.intReturn the Background executor shutdown seconds.Return the background executor wrapper.Return the list of BulkTableEventListener instances.intReturn the L2 cache default max idle time in seconds.intReturn the L2 cache default max size.intReturn 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).intReturn the number of DB sequence values that should be preallocated.Return the DataSource.io.ebean.datasource.DataSourceBuilder.SettingsReturn 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.EnumTypeReturn 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.intReturn the Geometry SRID.Return the history table suffix (defaults to _history).Return the custom IdGenerator instances.Return the preferred DB platform IdType.intReturn the default JDBC fetchSize hint for findEach/findEachWhile queries.intReturn 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.JsonFactoryReturn the Jackson JsonFactory to use.Return the JSON include mode used when writing JSON.io.ebean.annotation.MutationDetectionReturn the default MutableDetection to use with@DbJsonusing Jackson.intReturn 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.intReturn 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.PersistBatchReturn the PersistBatch mode to use by default at the transaction level.io.ebean.annotation.PersistBatchReturn the JDBC batch mode to use per save(), delete(), insert() or update() request.intReturn 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.intGets the query batch size.intReturn the L2 query cache default max idle time in seconds.intReturn the L2 query cache default max size.intReturn the L2 query cache default max time to live in seconds.intReturn the max number of query plans captured per request.longReturn the time after which a capture query plans request will stop capturing more query plans.longReturn the frequency to capture query plans.Return the listener used to process captured query plans.longReturn the query plan collection threshold in microseconds.intReturn the time to live for ebean's internal query plan.Return the read only DataSource.io.ebean.datasource.DataSourceBuilder.SettingsReturn the configuration for the read only DataSource.Returns the resource directory.Return the ServerCachePlugin.Return the list of ServerConfigStartup instances.<P> PgetServiceObject(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.longReturn 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.booleanReturn true if all DB column and table names should use quoted identifiers.booleanDeprecated, for removal: This API element is subject to removal in a future version.- migrate toisLoadModuleInfo().booleanReturn true if dirty beans are automatically persisted.booleanReturn true if Ebean should create a DataSource for use with implicit read only transactions.booleanReturn true (default) if the changelog should be written async.booleanReturn true if inserts should be included in the change log by default.booleanReturn true if the Database instance should be created in offline mode.booleanReturn true if the "drop all ddl" should be skipped.booleanReturn true, if extra-ddl.xml should be executed.booleanReturn true if the DDL should be generated.booleanisDdlRun()Return true if the DDL should be run.booleanReturn true if strict mode is used which includes a check that non-null columns have a default value.booleanReturn true if this server should be registered as the "default" server with the Ebean singleton.booleanReturn true if the class path search should be disabled.booleanReturn true if L2 cache is disabled.booleanReturn true if lazy loading is disabled on queries by default.booleanReturn true if metrics should be dumped when the server is shutdown.booleanReturn true if Duration should be persisted with nanos precision (SQL DECIMAL).booleanReturn true if LOB's should default to fetch eager.booleanReturn true if eq("someProperty", null) should to generate "1=1" rather than "is null" sql expression.booleanReturn true if native ILIKE expression should be used if supported by the database platform (e.g.booleanWhen false we need explicit@GeneratedValuemapping to assign Identity or Sequence generated values.booleanReturn true if generated sql select query should include an inline sql comment with the query label or profile location label.booleanReturn true if entity classes should be loaded and registered via EntityClassRegister.booleanReturn true to use local only L2 cache.booleanReturn true if LocalTime should be persisted with nanos precision.booleanReturn true if L2 cache notification should run in the foreground.booleanReturn true if periodic capture of query plans is enabled.booleanReturn true if query plan capture is enabled.booleanReturn true if this server should be registered with the Ebean singleton when it is created.booleanReturn true if the DB migration should run on server start.booleanReturn true if L2 bean cache should be skipped once writes have occurred on a transaction.booleanReturn true if transactions should rollback on checked exceptions.booleanReturns true if updates in JDBC batch default to include all properties by default.booleanReturn true if we are running in a JTA Transaction manager.booleanReturns if we use javax.validation.constraints.NotNulllengthCheck(LengthCheck lengthCheck) Sets the length check mode.protected voidThis is broken out to allow overridden behaviour.protected voidloads 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 voidLoad 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> DatabaseConfigputServiceObject(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.booleanReturn 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) voidsetClasses(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) booleanReturn 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, waitMethods 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:DatabaseBuilderBuild and return the Database instance.- Specified by:
buildin interfaceDatabaseBuilder
-
settings
Description copied from interface:DatabaseBuilderReturn the settings to read the configuration that has been set. This provides the getters/accessors to read the configuration properties.- Specified by:
settingsin interfaceDatabaseBuilder
-
apply
Description copied from interface:DatabaseBuilderApply configuration to this builder using a lambda.- Specified by:
applyin interfaceDatabaseBuilder
-
getClock
Description copied from interface:DatabaseBuilder.SettingsGet the clock used for setting the timestamps (e.g. @UpdatedTimestamp) on objects.- Specified by:
getClockin interfaceDatabaseBuilder.Settings
-
setClock
- Specified by:
setClockin interfaceDatabaseBuilder
-
getSlowQueryMillis
public long getSlowQueryMillis()Description copied from interface:DatabaseBuilder.SettingsReturn the slow query time in millis.- Specified by:
getSlowQueryMillisin interfaceDatabaseBuilder.Settings
-
setSlowQueryMillis
- Specified by:
setSlowQueryMillisin interfaceDatabaseBuilder
-
getSlowQueryListener
Description copied from interface:DatabaseBuilder.SettingsReturn the slow query event listener.- Specified by:
getSlowQueryListenerin interfaceDatabaseBuilder.Settings
-
setSlowQueryListener
- Specified by:
setSlowQueryListenerin interfaceDatabaseBuilder
-
putServiceObject
Description copied from interface:DatabaseBuilderPut 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:
putServiceObjectin interfaceDatabaseBuilder
-
putServiceObject
Description copied from interface:DatabaseBuilderPut 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:
putServiceObjectin interfaceDatabaseBuilder
-
getServiceObject
Description copied from interface:DatabaseBuilder.SettingsReturn the service object given the key.- Specified by:
getServiceObjectin interfaceDatabaseBuilder.Settings
-
putServiceObject
Description copied from interface:DatabaseBuilderPut a service object into configuration such that it can be used by ebean or a plugin.JedisPool jedisPool = .. config.putServiceObject(jedisPool);- Specified by:
putServiceObjectin interfaceDatabaseBuilder
-
getServiceObject
Description copied from interface:DatabaseBuilder.SettingsUsed by ebean or plugins to obtain service objects.JedisPool jedisPool = config.getServiceObject(JedisPool.class);- Specified by:
getServiceObjectin 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.SettingsReturn the Jackson JsonFactory to use.If not set a default implementation will be used.
- Specified by:
getJsonFactoryin interfaceDatabaseBuilder.Settings
-
setJsonFactory
- Specified by:
setJsonFactoryin interfaceDatabaseBuilder
-
getJsonDateTime
Description copied from interface:DatabaseBuilder.SettingsReturn the JSON format used for DateTime types.- Specified by:
getJsonDateTimein interfaceDatabaseBuilder.Settings
-
setJsonDateTime
- Specified by:
setJsonDateTimein interfaceDatabaseBuilder
-
getJsonDate
Description copied from interface:DatabaseBuilder.SettingsReturn the JSON format used for Date types.- Specified by:
getJsonDatein interfaceDatabaseBuilder.Settings
-
setJsonDate
- Specified by:
setJsonDatein interfaceDatabaseBuilder
-
getJsonInclude
Description copied from interface:DatabaseBuilder.SettingsReturn the JSON include mode used when writing JSON.- Specified by:
getJsonIncludein interfaceDatabaseBuilder.Settings
-
setJsonInclude
- Specified by:
setJsonIncludein interfaceDatabaseBuilder
-
getJsonMutationDetection
public io.ebean.annotation.MutationDetection getJsonMutationDetection()Description copied from interface:DatabaseBuilder.SettingsReturn the default MutableDetection to use with@DbJsonusing Jackson.- Specified by:
getJsonMutationDetectionin interfaceDatabaseBuilder.Settings- See Also:
-
setJsonMutationDetection
public DatabaseConfig setJsonMutationDetection(io.ebean.annotation.MutationDetection jsonMutationDetection) - Specified by:
setJsonMutationDetectionin interfaceDatabaseBuilder
-
getName
Description copied from interface:DatabaseBuilder.SettingsReturn the name of the Database.- Specified by:
getNamein interfaceDatabaseBuilder.Settings
-
setName
- Specified by:
setNamein interfaceDatabaseBuilder
-
getContainerConfig
Description copied from interface:DatabaseBuilder.SettingsReturn the container / clustering configuration. The container holds all the Database instances and provides clustering communication services to all the Database instances.- Specified by:
getContainerConfigin interfaceDatabaseBuilder.Settings
-
setContainerConfig
- Specified by:
setContainerConfigin interfaceDatabaseBuilder
-
isRegister
public boolean isRegister()Description copied from interface:DatabaseBuilder.SettingsReturn true if this server should be registered with the Ebean singleton when it is created.By default this is set to true.
- Specified by:
isRegisterin interfaceDatabaseBuilder.Settings
-
setRegister
- Specified by:
setRegisterin interfaceDatabaseBuilder
-
isDefaultServer
public boolean isDefaultServer()Description copied from interface:DatabaseBuilder.SettingsReturn 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:
isDefaultServerin interfaceDatabaseBuilder.Settings
-
setDefaultServer
- Specified by:
setDefaultServerin interfaceDatabaseBuilder
-
getCurrentUserProvider
Description copied from interface:DatabaseBuilder.SettingsReturn the CurrentUserProvider. This is used to populate @WhoCreated, @WhoModified and support other audit features (who executed a query etc).- Specified by:
getCurrentUserProviderin interfaceDatabaseBuilder.Settings
-
setCurrentUserProvider
- Specified by:
setCurrentUserProviderin interfaceDatabaseBuilder
-
getTenantMode
Description copied from interface:DatabaseBuilder.SettingsReturn the tenancy mode used.- Specified by:
getTenantModein interfaceDatabaseBuilder.Settings
-
setTenantMode
- Specified by:
setTenantModein interfaceDatabaseBuilder
-
getTenantPartitionColumn
Description copied from interface:DatabaseBuilder.SettingsReturn the column name used for TenantMode.PARTITION.- Specified by:
getTenantPartitionColumnin interfaceDatabaseBuilder.Settings
-
setTenantPartitionColumn
- Specified by:
setTenantPartitionColumnin interfaceDatabaseBuilder
-
getCurrentTenantProvider
Description copied from interface:DatabaseBuilder.SettingsReturn the current tenant provider.- Specified by:
getCurrentTenantProviderin interfaceDatabaseBuilder.Settings
-
setCurrentTenantProvider
- Specified by:
setCurrentTenantProviderin interfaceDatabaseBuilder
-
getTenantDataSourceProvider
Description copied from interface:DatabaseBuilder.SettingsReturn the tenancy datasource provider.- Specified by:
getTenantDataSourceProviderin interfaceDatabaseBuilder.Settings
-
setTenantDataSourceProvider
public DatabaseConfig setTenantDataSourceProvider(TenantDataSourceProvider tenantDataSourceProvider) - Specified by:
setTenantDataSourceProviderin interfaceDatabaseBuilder
-
getTenantSchemaProvider
Description copied from interface:DatabaseBuilder.SettingsReturn the tenancy schema provider.- Specified by:
getTenantSchemaProviderin interfaceDatabaseBuilder.Settings
-
setTenantSchemaProvider
- Specified by:
setTenantSchemaProviderin interfaceDatabaseBuilder
-
getTenantCatalogProvider
Description copied from interface:DatabaseBuilder.SettingsReturn the tenancy catalog provider.- Specified by:
getTenantCatalogProviderin interfaceDatabaseBuilder.Settings
-
setTenantCatalogProvider
- Specified by:
setTenantCatalogProviderin interfaceDatabaseBuilder
-
isAutoPersistUpdates
public boolean isAutoPersistUpdates()Description copied from interface:DatabaseBuilder.SettingsReturn true if dirty beans are automatically persisted.- Specified by:
isAutoPersistUpdatesin interfaceDatabaseBuilder.Settings
-
setAutoPersistUpdates
- Specified by:
setAutoPersistUpdatesin interfaceDatabaseBuilder
-
getPersistBatch
public io.ebean.annotation.PersistBatch getPersistBatch()Description copied from interface:DatabaseBuilder.SettingsReturn 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:
getPersistBatchin interfaceDatabaseBuilder.Settings
-
setPersistBatch
- Specified by:
setPersistBatchin interfaceDatabaseBuilder
-
getPersistBatchOnCascade
public io.ebean.annotation.PersistBatch getPersistBatchOnCascade()Description copied from interface:DatabaseBuilder.SettingsReturn 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:
getPersistBatchOnCascadein interfaceDatabaseBuilder.Settings
-
setPersistBatchOnCascade
public DatabaseConfig setPersistBatchOnCascade(io.ebean.annotation.PersistBatch persistBatchOnCascade) - Specified by:
setPersistBatchOnCascadein interfaceDatabaseBuilder
-
setPersistBatching
- Specified by:
setPersistBatchingin interfaceDatabaseBuilder
-
getPersistBatchSize
public int getPersistBatchSize()Description copied from interface:DatabaseBuilder.SettingsReturn the batch size used for JDBC batching. This defaults to 20.- Specified by:
getPersistBatchSizein interfaceDatabaseBuilder.Settings
-
setPersistBatchSize
- Specified by:
setPersistBatchSizein interfaceDatabaseBuilder
-
getQueryBatchSize
public int getQueryBatchSize()Description copied from interface:DatabaseBuilder.SettingsGets the query batch size. This defaults to 100.- Specified by:
getQueryBatchSizein interfaceDatabaseBuilder.Settings- Returns:
- the query batch size
-
setQueryBatchSize
- Specified by:
setQueryBatchSizein interfaceDatabaseBuilder
-
getDefaultEnumType
public jakarta.persistence.EnumType getDefaultEnumType()- Specified by:
getDefaultEnumTypein interfaceDatabaseBuilder.Settings
-
setDefaultEnumType
- Specified by:
setDefaultEnumTypein interfaceDatabaseBuilder
-
isDisableLazyLoading
public boolean isDisableLazyLoading()Description copied from interface:DatabaseBuilder.SettingsReturn true if lazy loading is disabled on queries by default.- Specified by:
isDisableLazyLoadingin interfaceDatabaseBuilder.Settings
-
setDisableLazyLoading
- Specified by:
setDisableLazyLoadingin interfaceDatabaseBuilder
-
getLazyLoadBatchSize
public int getLazyLoadBatchSize()Description copied from interface:DatabaseBuilder.SettingsReturn the default batch size for lazy loading of beans and collections.- Specified by:
getLazyLoadBatchSizein interfaceDatabaseBuilder.Settings
-
setLazyLoadBatchSize
- Specified by:
setLazyLoadBatchSizein interfaceDatabaseBuilder
-
setDatabaseSequenceBatchSize
- Specified by:
setDatabaseSequenceBatchSizein interfaceDatabaseBuilder
-
getJdbcFetchSizeFindList
public int getJdbcFetchSizeFindList()Description copied from interface:DatabaseBuilder.SettingsReturn the default JDBC fetchSize hint for findList queries.- Specified by:
getJdbcFetchSizeFindListin interfaceDatabaseBuilder.Settings
-
setJdbcFetchSizeFindList
- Specified by:
setJdbcFetchSizeFindListin interfaceDatabaseBuilder
-
getJdbcFetchSizeFindEach
public int getJdbcFetchSizeFindEach()Description copied from interface:DatabaseBuilder.SettingsReturn the default JDBC fetchSize hint for findEach/findEachWhile queries.- Specified by:
getJdbcFetchSizeFindEachin interfaceDatabaseBuilder.Settings
-
setJdbcFetchSizeFindEach
- Specified by:
setJdbcFetchSizeFindEachin interfaceDatabaseBuilder
-
getChangeLogPrepare
Description copied from interface:DatabaseBuilder.SettingsReturn 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:
getChangeLogPreparein interfaceDatabaseBuilder.Settings
-
setChangeLogPrepare
- Specified by:
setChangeLogPreparein interfaceDatabaseBuilder
-
getChangeLogListener
Description copied from interface:DatabaseBuilder.SettingsReturn the ChangeLogListener which actually performs the logging of change sets in the background.- Specified by:
getChangeLogListenerin interfaceDatabaseBuilder.Settings
-
setChangeLogListener
- Specified by:
setChangeLogListenerin interfaceDatabaseBuilder
-
getChangeLogRegister
Description copied from interface:DatabaseBuilder.SettingsReturn 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:
getChangeLogRegisterin interfaceDatabaseBuilder.Settings
-
setChangeLogRegister
- Specified by:
setChangeLogRegisterin interfaceDatabaseBuilder
-
isChangeLogIncludeInserts
public boolean isChangeLogIncludeInserts()Description copied from interface:DatabaseBuilder.SettingsReturn true if inserts should be included in the change log by default.- Specified by:
isChangeLogIncludeInsertsin interfaceDatabaseBuilder.Settings
-
setChangeLogIncludeInserts
- Specified by:
setChangeLogIncludeInsertsin interfaceDatabaseBuilder
-
isChangeLogAsync
public boolean isChangeLogAsync()Description copied from interface:DatabaseBuilder.SettingsReturn true (default) if the changelog should be written async.- Specified by:
isChangeLogAsyncin interfaceDatabaseBuilder.Settings
-
setChangeLogAsync
- Specified by:
setChangeLogAsyncin interfaceDatabaseBuilder
-
getProfilingConfig
Description copied from interface:DatabaseBuilder.SettingsReturn the configuration for profiling.- Specified by:
getProfilingConfigin interfaceDatabaseBuilder.Settings
-
setProfilingConfig
- Specified by:
setProfilingConfigin interfaceDatabaseBuilder
-
getDbSchema
Description copied from interface:DatabaseBuilder.SettingsReturn the DB schema to use.- Specified by:
getDbSchemain interfaceDatabaseBuilder.Settings
-
setDbSchema
- Specified by:
setDbSchemain interfaceDatabaseBuilder
-
getGeometrySRID
public int getGeometrySRID()Description copied from interface:DatabaseBuilder.SettingsReturn the Geometry SRID.- Specified by:
getGeometrySRIDin interfaceDatabaseBuilder.Settings
-
setGeometrySRID
- Specified by:
setGeometrySRIDin interfaceDatabaseBuilder
-
getDataTimeZone
Description copied from interface:DatabaseBuilder.SettingsReturn 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:
getDataTimeZonein interfaceDatabaseBuilder.Settings
-
setDataTimeZone
- Specified by:
setDataTimeZonein interfaceDatabaseBuilder
-
getAsOfViewSuffix
Description copied from interface:DatabaseBuilder.SettingsReturn 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:
getAsOfViewSuffixin interfaceDatabaseBuilder.Settings
-
setAsOfViewSuffix
- Specified by:
setAsOfViewSuffixin interfaceDatabaseBuilder
-
getAsOfSysPeriod
Description copied from interface:DatabaseBuilder.SettingsReturn the database column used to support history and 'As of' queries. This column is a timestamp range or equivalent.- Specified by:
getAsOfSysPeriodin interfaceDatabaseBuilder.Settings
-
setAsOfSysPeriod
- Specified by:
setAsOfSysPeriodin interfaceDatabaseBuilder
-
getHistoryTableSuffix
Description copied from interface:DatabaseBuilder.SettingsReturn the history table suffix (defaults to _history).- Specified by:
getHistoryTableSuffixin interfaceDatabaseBuilder.Settings
-
setHistoryTableSuffix
- Specified by:
setHistoryTableSuffixin interfaceDatabaseBuilder
-
isUseJtaTransactionManager
public boolean isUseJtaTransactionManager()Description copied from interface:DatabaseBuilder.SettingsReturn true if we are running in a JTA Transaction manager.- Specified by:
isUseJtaTransactionManagerin interfaceDatabaseBuilder.Settings
-
setUseJtaTransactionManager
- Specified by:
setUseJtaTransactionManagerin interfaceDatabaseBuilder
-
getExternalTransactionManager
Description copied from interface:DatabaseBuilder.SettingsReturn the external transaction manager.- Specified by:
getExternalTransactionManagerin interfaceDatabaseBuilder.Settings
-
setExternalTransactionManager
public DatabaseConfig setExternalTransactionManager(ExternalTransactionManager externalTransactionManager) - Specified by:
setExternalTransactionManagerin interfaceDatabaseBuilder
-
getServerCachePlugin
Description copied from interface:DatabaseBuilder.SettingsReturn the ServerCachePlugin.- Specified by:
getServerCachePluginin interfaceDatabaseBuilder.Settings
-
setServerCachePlugin
- Specified by:
setServerCachePluginin interfaceDatabaseBuilder
-
isEagerFetchLobs
public boolean isEagerFetchLobs()Description copied from interface:DatabaseBuilder.SettingsReturn 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:
isEagerFetchLobsin interfaceDatabaseBuilder.Settings
-
setEagerFetchLobs
- Specified by:
setEagerFetchLobsin interfaceDatabaseBuilder
-
getMaxCallStack
public int getMaxCallStack()Description copied from interface:DatabaseBuilder.SettingsReturn the max call stack to use for origin location.- Specified by:
getMaxCallStackin interfaceDatabaseBuilder.Settings
-
setMaxCallStack
- Specified by:
setMaxCallStackin interfaceDatabaseBuilder
-
isTransactionRollbackOnChecked
public boolean isTransactionRollbackOnChecked()Description copied from interface:DatabaseBuilder.SettingsReturn true if transactions should rollback on checked exceptions.- Specified by:
isTransactionRollbackOnCheckedin interfaceDatabaseBuilder.Settings
-
setTransactionRollbackOnChecked
- Specified by:
setTransactionRollbackOnCheckedin interfaceDatabaseBuilder
-
getBackgroundExecutorSchedulePoolSize
public int getBackgroundExecutorSchedulePoolSize()Description copied from interface:DatabaseBuilder.SettingsReturn the Background executor schedule pool size. Defaults to 1.- Specified by:
getBackgroundExecutorSchedulePoolSizein interfaceDatabaseBuilder.Settings
-
setBackgroundExecutorSchedulePoolSize
- Specified by:
setBackgroundExecutorSchedulePoolSizein interfaceDatabaseBuilder
-
getBackgroundExecutorShutdownSecs
public int getBackgroundExecutorShutdownSecs()Description copied from interface:DatabaseBuilder.SettingsReturn the Background executor shutdown seconds. This is the time allowed for the pool to shutdown nicely before it is forced shutdown.- Specified by:
getBackgroundExecutorShutdownSecsin interfaceDatabaseBuilder.Settings
-
setBackgroundExecutorShutdownSecs
- Specified by:
setBackgroundExecutorShutdownSecsin interfaceDatabaseBuilder
-
getBackgroundExecutorWrapper
Description copied from interface:DatabaseBuilder.SettingsReturn the background executor wrapper.- Specified by:
getBackgroundExecutorWrapperin interfaceDatabaseBuilder.Settings
-
setBackgroundExecutorWrapper
public DatabaseConfig setBackgroundExecutorWrapper(BackgroundExecutorWrapper backgroundExecutorWrapper) - Specified by:
setBackgroundExecutorWrapperin interfaceDatabaseBuilder
-
getCacheMaxSize
public int getCacheMaxSize()Description copied from interface:DatabaseBuilder.SettingsReturn the L2 cache default max size.- Specified by:
getCacheMaxSizein interfaceDatabaseBuilder.Settings
-
setCacheMaxSize
- Specified by:
setCacheMaxSizein interfaceDatabaseBuilder
-
getCacheMaxIdleTime
public int getCacheMaxIdleTime()Description copied from interface:DatabaseBuilder.SettingsReturn the L2 cache default max idle time in seconds.- Specified by:
getCacheMaxIdleTimein interfaceDatabaseBuilder.Settings
-
setCacheMaxIdleTime
- Specified by:
setCacheMaxIdleTimein interfaceDatabaseBuilder
-
getCacheMaxTimeToLive
public int getCacheMaxTimeToLive()Description copied from interface:DatabaseBuilder.SettingsReturn the L2 cache default max time to live in seconds.- Specified by:
getCacheMaxTimeToLivein interfaceDatabaseBuilder.Settings
-
setCacheMaxTimeToLive
- Specified by:
setCacheMaxTimeToLivein interfaceDatabaseBuilder
-
getQueryCacheMaxSize
public int getQueryCacheMaxSize()Description copied from interface:DatabaseBuilder.SettingsReturn the L2 query cache default max size.- Specified by:
getQueryCacheMaxSizein interfaceDatabaseBuilder.Settings
-
setQueryCacheMaxSize
- Specified by:
setQueryCacheMaxSizein interfaceDatabaseBuilder
-
getQueryCacheMaxIdleTime
public int getQueryCacheMaxIdleTime()Description copied from interface:DatabaseBuilder.SettingsReturn the L2 query cache default max idle time in seconds.- Specified by:
getQueryCacheMaxIdleTimein interfaceDatabaseBuilder.Settings
-
setQueryCacheMaxIdleTime
- Specified by:
setQueryCacheMaxIdleTimein interfaceDatabaseBuilder
-
getQueryCacheMaxTimeToLive
public int getQueryCacheMaxTimeToLive()Description copied from interface:DatabaseBuilder.SettingsReturn the L2 query cache default max time to live in seconds.- Specified by:
getQueryCacheMaxTimeToLivein interfaceDatabaseBuilder.Settings
-
setQueryCacheMaxTimeToLive
- Specified by:
setQueryCacheMaxTimeToLivein interfaceDatabaseBuilder
-
getNamingConvention
Description copied from interface:DatabaseBuilder.SettingsReturn the NamingConvention.If none has been set the default UnderscoreNamingConvention is used.
- Specified by:
getNamingConventionin interfaceDatabaseBuilder.Settings
-
setNamingConvention
- Specified by:
setNamingConventionin interfaceDatabaseBuilder
-
isAllQuotedIdentifiers
public boolean isAllQuotedIdentifiers()Description copied from interface:DatabaseBuilder.SettingsReturn true if all DB column and table names should use quoted identifiers.- Specified by:
isAllQuotedIdentifiersin interfaceDatabaseBuilder.Settings
-
setAllQuotedIdentifiers
- Specified by:
setAllQuotedIdentifiersin interfaceDatabaseBuilder
-
getConstraintNaming
Description copied from interface:DatabaseBuilder.SettingsReturn the constraint naming convention used in DDL generation.- Specified by:
getConstraintNamingin interfaceDatabaseBuilder.Settings
-
setConstraintNaming
- Specified by:
setConstraintNamingin interfaceDatabaseBuilder
-
getAutoTuneConfig
Description copied from interface:DatabaseBuilder.SettingsReturn the configuration for AutoTune.- Specified by:
getAutoTuneConfigin interfaceDatabaseBuilder.Settings
-
setAutoTuneConfig
- Specified by:
setAutoTuneConfigin interfaceDatabaseBuilder
-
skipDataSourceCheck
public boolean skipDataSourceCheck()Description copied from interface:DatabaseBuilder.SettingsReturn true if the startup DataSource check should be skipped.- Specified by:
skipDataSourceCheckin interfaceDatabaseBuilder.Settings
-
setSkipDataSourceCheck
- Specified by:
setSkipDataSourceCheckin interfaceDatabaseBuilder
-
readOnlyDatabase
Description copied from interface:DatabaseBuilderSet 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:
readOnlyDatabasein interfaceDatabaseBuilder
-
readOnlyDatabase
public boolean readOnlyDatabase()Description copied from interface:DatabaseBuilder.SettingsReturn 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:
readOnlyDatabasein interfaceDatabaseBuilder.Settings
-
getDataSource
Description copied from interface:DatabaseBuilder.SettingsReturn the DataSource.- Specified by:
getDataSourcein interfaceDatabaseBuilder.Settings
-
setDataSource
- Specified by:
setDataSourcein interfaceDatabaseBuilder
-
getReadOnlyDataSource
Description copied from interface:DatabaseBuilder.SettingsReturn the read only DataSource.- Specified by:
getReadOnlyDataSourcein interfaceDatabaseBuilder.Settings
-
setReadOnlyDataSource
- Specified by:
setReadOnlyDataSourcein interfaceDatabaseBuilder
-
getDataSourceConfig
public io.ebean.datasource.DataSourceBuilder.Settings getDataSourceConfig()Description copied from interface:DatabaseBuilder.SettingsReturn the configuration to build a DataSource using Ebean's own DataSource implementation.- Specified by:
getDataSourceConfigin interfaceDatabaseBuilder.Settings
-
setDataSourceConfig
- Specified by:
setDataSourceConfigin interfaceDatabaseBuilder
-
isAutoReadOnlyDataSource
public boolean isAutoReadOnlyDataSource()Description copied from interface:DatabaseBuilder.SettingsReturn true if Ebean should create a DataSource for use with implicit read only transactions.- Specified by:
isAutoReadOnlyDataSourcein interfaceDatabaseBuilder.Settings
-
setAutoReadOnlyDataSource
- Specified by:
setAutoReadOnlyDataSourcein interfaceDatabaseBuilder
-
getReadOnlyDataSourceConfig
public io.ebean.datasource.DataSourceBuilder.Settings getReadOnlyDataSourceConfig()Description copied from interface:DatabaseBuilder.SettingsReturn 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:
getReadOnlyDataSourceConfigin interfaceDatabaseBuilder.Settings
-
setReadOnlyDataSourceConfig
- Specified by:
setReadOnlyDataSourceConfigin interfaceDatabaseBuilder
-
getDatabaseBooleanTrue
Description copied from interface:DatabaseBuilder.SettingsReturn 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:
getDatabaseBooleanTruein interfaceDatabaseBuilder.Settings
-
setDatabaseBooleanTrue
- Specified by:
setDatabaseBooleanTruein interfaceDatabaseBuilder
-
getDatabaseBooleanFalse
Description copied from interface:DatabaseBuilder.SettingsReturn 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:
getDatabaseBooleanFalsein interfaceDatabaseBuilder.Settings
-
setDatabaseBooleanFalse
- Specified by:
setDatabaseBooleanFalsein interfaceDatabaseBuilder
-
getDatabaseSequenceBatchSize
public int getDatabaseSequenceBatchSize()Description copied from interface:DatabaseBuilder.SettingsReturn the number of DB sequence values that should be preallocated.- Specified by:
getDatabaseSequenceBatchSizein interfaceDatabaseBuilder.Settings
-
setDatabaseSequenceBatch
- Specified by:
setDatabaseSequenceBatchin interfaceDatabaseBuilder
-
getDatabasePlatformName
Description copied from interface:DatabaseBuilder.SettingsReturn the database platform name (can be null).If null then the platform is determined automatically via the JDBC driver information.
- Specified by:
getDatabasePlatformNamein interfaceDatabaseBuilder.Settings
-
setDatabasePlatformName
- Specified by:
setDatabasePlatformNamein interfaceDatabaseBuilder
-
getDatabasePlatform
Description copied from interface:DatabaseBuilder.SettingsReturn the database platform to use for this database.- Specified by:
getDatabasePlatformin interfaceDatabaseBuilder.Settings
-
setDatabasePlatform
- Specified by:
setDatabasePlatformin interfaceDatabaseBuilder
-
getIdType
Description copied from interface:DatabaseBuilder.SettingsReturn the preferred DB platform IdType.- Specified by:
getIdTypein interfaceDatabaseBuilder.Settings
-
setIdType
- Specified by:
setIdTypein interfaceDatabaseBuilder
-
getEncryptKeyManager
Description copied from interface:DatabaseBuilder.SettingsReturn the EncryptKeyManager.- Specified by:
getEncryptKeyManagerin interfaceDatabaseBuilder.Settings
-
setEncryptKeyManager
- Specified by:
setEncryptKeyManagerin interfaceDatabaseBuilder
-
getEncryptDeployManager
Description copied from interface:DatabaseBuilder.SettingsReturn the EncryptDeployManager.This is optionally used to programmatically define which columns are encrypted instead of using the
EncryptedAnnotation.- Specified by:
getEncryptDeployManagerin interfaceDatabaseBuilder.Settings
-
setEncryptDeployManager
- Specified by:
setEncryptDeployManagerin interfaceDatabaseBuilder
-
getEncryptor
Description copied from interface:DatabaseBuilder.SettingsReturn the Encryptor used to encrypt data on the java client side (as opposed to DB encryption functions).- Specified by:
getEncryptorin interfaceDatabaseBuilder.Settings
-
setEncryptor
- Specified by:
setEncryptorin interfaceDatabaseBuilder
-
isDbOffline
public boolean isDbOffline()Description copied from interface:DatabaseBuilder.SettingsReturn true if the Database instance should be created in offline mode.- Specified by:
isDbOfflinein interfaceDatabaseBuilder.Settings
-
setDbOffline
- Specified by:
setDbOfflinein interfaceDatabaseBuilder
-
getDbEncrypt
Description copied from interface:DatabaseBuilder.SettingsReturn 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:
getDbEncryptin interfaceDatabaseBuilder.Settings
-
setDbEncrypt
- Specified by:
setDbEncryptin interfaceDatabaseBuilder
-
getPlatformConfig
Description copied from interface:DatabaseBuilder.SettingsReturn the configuration for DB types (such as UUID and custom mappings).- Specified by:
getPlatformConfigin interfaceDatabaseBuilder.Settings
-
setPlatformConfig
- Specified by:
setPlatformConfigin interfaceDatabaseBuilder
-
setDbUuid
- Specified by:
setDbUuidin interfaceDatabaseBuilder
-
getUuidVersion
Description copied from interface:DatabaseBuilder.SettingsReturns the UUID version mode.- Specified by:
getUuidVersionin interfaceDatabaseBuilder.Settings
-
setUuidVersion
- Specified by:
setUuidVersionin interfaceDatabaseBuilder
-
getUuidStateFile
Description copied from interface:DatabaseBuilder.SettingsReturn the UUID state file.- Specified by:
getUuidStateFilein interfaceDatabaseBuilder.Settings
-
setUuidStateFile
- Specified by:
setUuidStateFilein interfaceDatabaseBuilder
-
getUuidNodeId
Description copied from interface:DatabaseBuilder.SettingsReturns the V1-UUID-NodeId- Specified by:
getUuidNodeIdin interfaceDatabaseBuilder.Settings
-
setUuidNodeId
- Specified by:
setUuidNodeIdin interfaceDatabaseBuilder
-
isLocalTimeWithNanos
public boolean isLocalTimeWithNanos()Description copied from interface:DatabaseBuilder.SettingsReturn true if LocalTime should be persisted with nanos precision.- Specified by:
isLocalTimeWithNanosin interfaceDatabaseBuilder.Settings
-
setLocalTimeWithNanos
- Specified by:
setLocalTimeWithNanosin interfaceDatabaseBuilder
-
isDurationWithNanos
public boolean isDurationWithNanos()Description copied from interface:DatabaseBuilder.SettingsReturn true if Duration should be persisted with nanos precision (SQL DECIMAL).Otherwise it is persisted with second precision (SQL INTEGER).
- Specified by:
isDurationWithNanosin interfaceDatabaseBuilder.Settings
-
setDurationWithNanos
- Specified by:
setDurationWithNanosin interfaceDatabaseBuilder
-
setRunMigration
- Specified by:
setRunMigrationin interfaceDatabaseBuilder
-
isRunMigration
public boolean isRunMigration()Description copied from interface:DatabaseBuilder.SettingsReturn true if the DB migration should run on server start.- Specified by:
isRunMigrationin interfaceDatabaseBuilder.Settings
-
setDdlGenerate
- Specified by:
setDdlGeneratein interfaceDatabaseBuilder
-
setDdlRun
- Specified by:
setDdlRunin interfaceDatabaseBuilder
-
setDdlExtra
- Specified by:
setDdlExtrain interfaceDatabaseBuilder
-
isDdlCreateOnly
public boolean isDdlCreateOnly()Description copied from interface:DatabaseBuilder.SettingsReturn 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:
isDdlCreateOnlyin interfaceDatabaseBuilder.Settings
-
setDdlCreateOnly
- Specified by:
setDdlCreateOnlyin interfaceDatabaseBuilder
-
getDdlSeedSql
Description copied from interface:DatabaseBuilder.SettingsReturn 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:
getDdlSeedSqlin interfaceDatabaseBuilder.Settings
-
setDdlSeedSql
- Specified by:
setDdlSeedSqlin interfaceDatabaseBuilder
-
getDdlInitSql
Description copied from interface:DatabaseBuilder.SettingsReturn a SQL script to execute before the "create all" DDL has been run.- Specified by:
getDdlInitSqlin interfaceDatabaseBuilder.Settings
-
setDdlInitSql
- Specified by:
setDdlInitSqlin interfaceDatabaseBuilder
-
isDdlGenerate
public boolean isDdlGenerate()Description copied from interface:DatabaseBuilder.SettingsReturn true if the DDL should be generated.- Specified by:
isDdlGeneratein interfaceDatabaseBuilder.Settings
-
isDdlRun
public boolean isDdlRun()Description copied from interface:DatabaseBuilder.SettingsReturn true if the DDL should be run.- Specified by:
isDdlRunin interfaceDatabaseBuilder.Settings
-
isDdlExtra
public boolean isDdlExtra()Description copied from interface:DatabaseBuilder.SettingsReturn true, if extra-ddl.xml should be executed.- Specified by:
isDdlExtrain interfaceDatabaseBuilder.Settings
-
setDdlHeader
- Specified by:
setDdlHeaderin interfaceDatabaseBuilder
-
getDdlHeader
Description copied from interface:DatabaseBuilder.SettingsReturn the header to use with DDL generation.- Specified by:
getDdlHeaderin interfaceDatabaseBuilder.Settings
-
isDdlStrictMode
public boolean isDdlStrictMode()Description copied from interface:DatabaseBuilder.SettingsReturn true if strict mode is used which includes a check that non-null columns have a default value.- Specified by:
isDdlStrictModein interfaceDatabaseBuilder.Settings
-
setDdlStrictMode
- Specified by:
setDdlStrictModein interfaceDatabaseBuilder
-
getDdlPlaceholders
Description copied from interface:DatabaseBuilder.SettingsReturn a comma and equals delimited placeholders that are substituted in DDL scripts.- Specified by:
getDdlPlaceholdersin interfaceDatabaseBuilder.Settings
-
setDdlPlaceholders
- Specified by:
setDdlPlaceholdersin interfaceDatabaseBuilder
-
getDdlPlaceholderMap
Description copied from interface:DatabaseBuilder.SettingsReturn a map of placeholder values that are substituted in DDL scripts.- Specified by:
getDdlPlaceholderMapin interfaceDatabaseBuilder.Settings
-
setDdlPlaceholderMap
- Specified by:
setDdlPlaceholderMapin interfaceDatabaseBuilder
-
isDisableClasspathSearch
public boolean isDisableClasspathSearch()Description copied from interface:DatabaseBuilder.SettingsReturn true if the class path search should be disabled.- Specified by:
isDisableClasspathSearchin interfaceDatabaseBuilder.Settings
-
setDisableClasspathSearch
- Specified by:
setDisableClasspathSearchin interfaceDatabaseBuilder
-
getJodaLocalTimeMode
Description copied from interface:DatabaseBuilder.SettingsReturn the mode to use for Joda LocalTime support 'normal' or 'utc'.- Specified by:
getJodaLocalTimeModein interfaceDatabaseBuilder.Settings
-
setJodaLocalTimeMode
- Specified by:
setJodaLocalTimeModein interfaceDatabaseBuilder
-
addClass
Description copied from interface:DatabaseBuilderProgrammatically 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:
addClassin interfaceDatabaseBuilder- Parameters:
cls- the entity type (or other type) that should be registered by this database.
-
addAll
Description copied from interface:DatabaseBuilderRegister all the classes (typically entity classes).- Specified by:
addAllin interfaceDatabaseBuilder
-
addPackage
Description copied from interface:DatabaseBuilderAdd a package to search for entities via class path search.This is only used if classes have not been explicitly specified.
- Specified by:
addPackagein interfaceDatabaseBuilder
-
getPackages
Description copied from interface:DatabaseBuilder.SettingsReturn packages to search for entities via class path search.This is only used if classes have not been explicitly specified.
- Specified by:
getPackagesin interfaceDatabaseBuilder.Settings
-
setPackages
Description copied from interface:DatabaseBuilderSet packages to search for entities via class path search.This is only used if classes have not been explicitly specified.
- Specified by:
setPackagesin 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:DatabaseBuilderSet 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:
classesin interfaceDatabaseBuilder
-
classes
Description copied from interface:DatabaseBuilder.SettingsReturn the classes registered for this database. Typically, this includes entities and perhaps listeners.- Specified by:
classesin interfaceDatabaseBuilder.Settings
-
getClasses
Deprecated, for removal: This API element is subject to removal in a future version.- migrate toclasses().- Specified by:
getClassesin interfaceDatabaseBuilder.Settings
-
isSkipCacheAfterWrite
public boolean isSkipCacheAfterWrite()Description copied from interface:DatabaseBuilder.SettingsReturn 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:
isSkipCacheAfterWritein interfaceDatabaseBuilder.Settings- See Also:
-
setSkipCacheAfterWrite
- Specified by:
setSkipCacheAfterWritein interfaceDatabaseBuilder
-
isUpdateAllPropertiesInBatch
public boolean isUpdateAllPropertiesInBatch()Description copied from interface:DatabaseBuilder.SettingsReturns true if updates in JDBC batch default to include all properties by default.- Specified by:
isUpdateAllPropertiesInBatchin interfaceDatabaseBuilder.Settings
-
setUpdateAllPropertiesInBatch
- Specified by:
setUpdateAllPropertiesInBatchin interfaceDatabaseBuilder
-
getResourceDirectory
Description copied from interface:DatabaseBuilder.SettingsReturns the resource directory.- Specified by:
getResourceDirectoryin interfaceDatabaseBuilder.Settings
-
setResourceDirectory
- Specified by:
setResourceDirectoryin interfaceDatabaseBuilder
-
addCustomMapping
public DatabaseConfig addCustomMapping(DbType type, String columnDefinition, io.ebean.annotation.Platform platform) Description copied from interface:DatabaseBuilderAdd 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:
addCustomMappingin 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:DatabaseBuilderAdd 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:
addCustomMappingin interfaceDatabaseBuilder- Parameters:
type- The DB type this mapping should apply tocolumnDefinition- The column definition that should be used
-
add
Description copied from interface:DatabaseBuilderRegister a BeanQueryAdapter instance.Note alternatively you can use
DatabaseBuilder.setQueryAdapters(List)to set all the BeanQueryAdapter instances.- Specified by:
addin interfaceDatabaseBuilder
-
getQueryAdapters
Description copied from interface:DatabaseBuilder.SettingsReturn the BeanQueryAdapter instances.- Specified by:
getQueryAdaptersin interfaceDatabaseBuilder.Settings
-
setQueryAdapters
Description copied from interface:DatabaseBuilderRegister all the BeanQueryAdapter instances.Note alternatively you can use
DatabaseBuilder.add(BeanQueryAdapter)to add BeanQueryAdapter instances one at a time.- Specified by:
setQueryAdaptersin interfaceDatabaseBuilder
-
getIdGenerators
Description copied from interface:DatabaseBuilder.SettingsReturn the custom IdGenerator instances.- Specified by:
getIdGeneratorsin interfaceDatabaseBuilder.Settings
-
setIdGenerators
Description copied from interface:DatabaseBuilderSet the custom IdGenerator instances.- Specified by:
setIdGeneratorsin interfaceDatabaseBuilder
-
add
Description copied from interface:DatabaseBuilderRegister a customer IdGenerator instance.- Specified by:
addin interfaceDatabaseBuilder
-
add
Description copied from interface:DatabaseBuilderRegister a BeanPersistController instance.Note alternatively you can use
DatabaseBuilder.setPersistControllers(List)to set all the BeanPersistController instances.- Specified by:
addin interfaceDatabaseBuilder
-
add
Description copied from interface:DatabaseBuilderRegister a BeanPostLoad instance.Note alternatively you can use
DatabaseBuilder.setPostLoaders(List)to set all the BeanPostLoad instances.- Specified by:
addin interfaceDatabaseBuilder
-
add
Description copied from interface:DatabaseBuilderRegister a BeanPostConstructListener instance.Note alternatively you can use
DatabaseBuilder.setPostConstructListeners(List)to set all the BeanPostConstructListener instances.- Specified by:
addin interfaceDatabaseBuilder
-
getFindControllers
Description copied from interface:DatabaseBuilder.SettingsReturn the list of BeanFindController instances.- Specified by:
getFindControllersin interfaceDatabaseBuilder.Settings
-
setFindControllers
Description copied from interface:DatabaseBuilderSet the list of BeanFindController instances.- Specified by:
setFindControllersin interfaceDatabaseBuilder
-
getPostLoaders
Description copied from interface:DatabaseBuilder.SettingsReturn the list of BeanPostLoader instances.- Specified by:
getPostLoadersin interfaceDatabaseBuilder.Settings
-
setPostLoaders
Description copied from interface:DatabaseBuilderSet the list of BeanPostLoader instances.- Specified by:
setPostLoadersin interfaceDatabaseBuilder
-
getPostConstructListeners
Description copied from interface:DatabaseBuilder.SettingsReturn the list of BeanPostLoader instances.- Specified by:
getPostConstructListenersin interfaceDatabaseBuilder.Settings
-
setPostConstructListeners
Description copied from interface:DatabaseBuilderSet the list of BeanPostLoader instances.- Specified by:
setPostConstructListenersin interfaceDatabaseBuilder
-
getPersistControllers
Description copied from interface:DatabaseBuilder.SettingsReturn the BeanPersistController instances.- Specified by:
getPersistControllersin interfaceDatabaseBuilder.Settings
-
setPersistControllers
Description copied from interface:DatabaseBuilderRegister all the BeanPersistController instances.Note alternatively you can use
DatabaseBuilder.add(BeanPersistController)to add BeanPersistController instances one at a time.- Specified by:
setPersistControllersin interfaceDatabaseBuilder
-
add
Description copied from interface:DatabaseBuilderRegister a BeanPersistListener instance.Note alternatively you can use
DatabaseBuilder.setPersistListeners(List)to set all the BeanPersistListener instances.- Specified by:
addin interfaceDatabaseBuilder
-
getPersistListeners
Description copied from interface:DatabaseBuilder.SettingsReturn the BeanPersistListener instances.- Specified by:
getPersistListenersin interfaceDatabaseBuilder.Settings
-
add
Description copied from interface:DatabaseBuilderAdd a BulkTableEventListener- Specified by:
addin interfaceDatabaseBuilder
-
getBulkTableEventListeners
Description copied from interface:DatabaseBuilder.SettingsReturn the list of BulkTableEventListener instances.- Specified by:
getBulkTableEventListenersin interfaceDatabaseBuilder.Settings
-
addServerConfigStartup
Description copied from interface:DatabaseBuilderAdd a ServerConfigStartup.- Specified by:
addServerConfigStartupin interfaceDatabaseBuilder
-
getServerConfigStartupListeners
Description copied from interface:DatabaseBuilder.SettingsReturn the list of ServerConfigStartup instances.- Specified by:
getServerConfigStartupListenersin interfaceDatabaseBuilder.Settings
-
setPersistListeners
Description copied from interface:DatabaseBuilderRegister all the BeanPersistListener instances.Note alternatively you can use
DatabaseBuilder.add(BeanPersistListener)to add BeanPersistListener instances one at a time.- Specified by:
setPersistListenersin interfaceDatabaseBuilder
-
getPersistenceContextScope
Description copied from interface:DatabaseBuilder.SettingsReturn 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:
getPersistenceContextScopein interfaceDatabaseBuilder.Settings- See Also:
-
setPersistenceContextScope
- Specified by:
setPersistenceContextScopein interfaceDatabaseBuilder
-
getClassLoadConfig
Description copied from interface:DatabaseBuilder.SettingsReturn the ClassLoadConfig which is used to detect Joda, Java8 types etc and also create new instances of plugins given a className.- Specified by:
getClassLoadConfigin interfaceDatabaseBuilder.Settings
-
setClassLoadConfig
- Specified by:
setClassLoadConfigin interfaceDatabaseBuilder
-
loadFromProperties
Description copied from interface:DatabaseBuilderLoad settings from application.properties, application.yaml and other sources.Uses
avaje-configto load configuration properties. Goto https://avaje.io/config for detail on how and where properties are loaded from.- Specified by:
loadFromPropertiesin interfaceDatabaseBuilder
-
loadFromProperties
Description copied from interface:DatabaseBuilderLoad the settings from the given properties- Specified by:
loadFromPropertiesin interfaceDatabaseBuilder
-
getProperties
Description copied from interface:DatabaseBuilder.SettingsReturn the properties that we used for configuration and were set via a call to loadFromProperties().- Specified by:
getPropertiesin 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.SettingsReturn the PersistBatch mode to use for 'batchOnCascade' taking into account if the database platform supports getGeneratedKeys in batch mode.- Specified by:
appliedPersistBatchOnCascadein interfaceDatabaseBuilder.Settings
-
getObjectMapper
Description copied from interface:DatabaseBuilder.SettingsReturn the Jackson ObjectMapper.Note that this is not strongly typed as Jackson ObjectMapper is an optional dependency.
- Specified by:
getObjectMapperin interfaceDatabaseBuilder.Settings
-
setObjectMapper
- Specified by:
setObjectMapperin interfaceDatabaseBuilder
-
isExpressionEqualsWithNullAsNoop
public boolean isExpressionEqualsWithNullAsNoop()Description copied from interface:DatabaseBuilder.SettingsReturn true if eq("someProperty", null) should to generate "1=1" rather than "is null" sql expression.- Specified by:
isExpressionEqualsWithNullAsNoopin interfaceDatabaseBuilder.Settings
-
setExpressionEqualsWithNullAsNoop
- Specified by:
setExpressionEqualsWithNullAsNoopin interfaceDatabaseBuilder
-
isExpressionNativeIlike
public boolean isExpressionNativeIlike()Description copied from interface:DatabaseBuilder.SettingsReturn true if native ILIKE expression should be used if supported by the database platform (e.g. Postgres).- Specified by:
isExpressionNativeIlikein interfaceDatabaseBuilder.Settings
-
setExpressionNativeIlike
- Specified by:
setExpressionNativeIlikein interfaceDatabaseBuilder
-
getEnabledL2Regions
Description copied from interface:DatabaseBuilder.SettingsReturn the enabled L2 cache regions.- Specified by:
getEnabledL2Regionsin interfaceDatabaseBuilder.Settings
-
setEnabledL2Regions
- Specified by:
setEnabledL2Regionsin interfaceDatabaseBuilder
-
isDisableL2Cache
public boolean isDisableL2Cache()Description copied from interface:DatabaseBuilder.SettingsReturn true if L2 cache is disabled.- Specified by:
isDisableL2Cachein interfaceDatabaseBuilder.Settings
-
setDisableL2Cache
- Specified by:
setDisableL2Cachein interfaceDatabaseBuilder
-
isLocalOnlyL2Cache
public boolean isLocalOnlyL2Cache()Description copied from interface:DatabaseBuilder.SettingsReturn true to use local only L2 cache. Effectively ignore l2 cache plugin like ebean-redis etc.- Specified by:
isLocalOnlyL2Cachein interfaceDatabaseBuilder.Settings
-
setLocalOnlyL2Cache
- Specified by:
setLocalOnlyL2Cachein interfaceDatabaseBuilder
-
isUseValidationNotNull
public boolean isUseValidationNotNull()Description copied from interface:DatabaseBuilder.SettingsReturns if we use javax.validation.constraints.NotNull- Specified by:
isUseValidationNotNullin interfaceDatabaseBuilder.Settings
-
setUseValidationNotNull
- Specified by:
setUseValidationNotNullin interfaceDatabaseBuilder
-
isNotifyL2CacheInForeground
public boolean isNotifyL2CacheInForeground()Description copied from interface:DatabaseBuilder.SettingsReturn true if L2 cache notification should run in the foreground.- Specified by:
isNotifyL2CacheInForegroundin interfaceDatabaseBuilder.Settings
-
setNotifyL2CacheInForeground
- Specified by:
setNotifyL2CacheInForegroundin interfaceDatabaseBuilder
-
getQueryPlanTTLSeconds
public int getQueryPlanTTLSeconds()Description copied from interface:DatabaseBuilder.SettingsReturn the time to live for ebean's internal query plan.- Specified by:
getQueryPlanTTLSecondsin interfaceDatabaseBuilder.Settings
-
setQueryPlanTTLSeconds
- Specified by:
setQueryPlanTTLSecondsin interfaceDatabaseBuilder
-
newPlatformConfig
Description copied from interface:DatabaseBuilderCreate 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:
newPlatformConfigin 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:DatabaseBuilderAdd a mapping location to search for xml mapping via class path search.- Specified by:
addMappingLocationin interfaceDatabaseBuilder
-
getMappingLocations
Description copied from interface:DatabaseBuilder.SettingsReturn mapping locations to search for xml mapping via class path search.- Specified by:
getMappingLocationsin interfaceDatabaseBuilder.Settings
-
setMappingLocations
- Specified by:
setMappingLocationsin interfaceDatabaseBuilder
-
isIdGeneratorAutomatic
public boolean isIdGeneratorAutomatic()Description copied from interface:DatabaseBuilder.SettingsWhen false we need explicit@GeneratedValuemapping to assign Identity or Sequence generated values. When true Id properties are automatically assigned Identity or Sequence without the GeneratedValue mapping.- Specified by:
isIdGeneratorAutomaticin interfaceDatabaseBuilder.Settings
-
setIdGeneratorAutomatic
- Specified by:
setIdGeneratorAutomaticin interfaceDatabaseBuilder
-
isQueryPlanEnable
public boolean isQueryPlanEnable()Description copied from interface:DatabaseBuilder.SettingsReturn true if query plan capture is enabled.- Specified by:
isQueryPlanEnablein interfaceDatabaseBuilder.Settings
-
setQueryPlanEnable
- Specified by:
setQueryPlanEnablein interfaceDatabaseBuilder
-
getQueryPlanThresholdMicros
public long getQueryPlanThresholdMicros()Description copied from interface:DatabaseBuilder.SettingsReturn the query plan collection threshold in microseconds.- Specified by:
getQueryPlanThresholdMicrosin interfaceDatabaseBuilder.Settings
-
setQueryPlanThresholdMicros
- Specified by:
setQueryPlanThresholdMicrosin interfaceDatabaseBuilder
-
isQueryPlanCapture
public boolean isQueryPlanCapture()Description copied from interface:DatabaseBuilder.SettingsReturn true if periodic capture of query plans is enabled.- Specified by:
isQueryPlanCapturein interfaceDatabaseBuilder.Settings
-
setQueryPlanCapture
- Specified by:
setQueryPlanCapturein interfaceDatabaseBuilder
-
getQueryPlanCapturePeriodSecs
public long getQueryPlanCapturePeriodSecs()Description copied from interface:DatabaseBuilder.SettingsReturn the frequency to capture query plans.- Specified by:
getQueryPlanCapturePeriodSecsin interfaceDatabaseBuilder.Settings
-
setQueryPlanCapturePeriodSecs
- Specified by:
setQueryPlanCapturePeriodSecsin interfaceDatabaseBuilder
-
getQueryPlanCaptureMaxTimeMillis
public long getQueryPlanCaptureMaxTimeMillis()Description copied from interface:DatabaseBuilder.SettingsReturn 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:
getQueryPlanCaptureMaxTimeMillisin interfaceDatabaseBuilder.Settings
-
setQueryPlanCaptureMaxTimeMillis
- Specified by:
setQueryPlanCaptureMaxTimeMillisin interfaceDatabaseBuilder
-
getQueryPlanCaptureMaxCount
public int getQueryPlanCaptureMaxCount()Description copied from interface:DatabaseBuilder.SettingsReturn the max number of query plans captured per request.- Specified by:
getQueryPlanCaptureMaxCountin interfaceDatabaseBuilder.Settings
-
setQueryPlanCaptureMaxCount
- Specified by:
setQueryPlanCaptureMaxCountin interfaceDatabaseBuilder
-
getQueryPlanListener
Description copied from interface:DatabaseBuilder.SettingsReturn the listener used to process captured query plans.- Specified by:
getQueryPlanListenerin interfaceDatabaseBuilder.Settings
-
setQueryPlanListener
- Specified by:
setQueryPlanListenerin interfaceDatabaseBuilder
-
isDumpMetricsOnShutdown
public boolean isDumpMetricsOnShutdown()Description copied from interface:DatabaseBuilder.SettingsReturn true if metrics should be dumped when the server is shutdown.- Specified by:
isDumpMetricsOnShutdownin interfaceDatabaseBuilder.Settings
-
setDumpMetricsOnShutdown
- Specified by:
setDumpMetricsOnShutdownin interfaceDatabaseBuilder
-
getDumpMetricsOptions
Description copied from interface:DatabaseBuilder.SettingsReturn the options for dumping metrics.- Specified by:
getDumpMetricsOptionsin interfaceDatabaseBuilder.Settings
-
setDumpMetricsOptions
- Specified by:
setDumpMetricsOptionsin interfaceDatabaseBuilder
-
isLoadModuleInfo
public boolean isLoadModuleInfo()Description copied from interface:DatabaseBuilder.SettingsReturn 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:
isLoadModuleInfoin interfaceDatabaseBuilder.Settings
-
isIncludeLabelInSql
public boolean isIncludeLabelInSql()Description copied from interface:DatabaseBuilder.SettingsReturn true if generated sql select query should include an inline sql comment with the query label or profile location label.- Specified by:
isIncludeLabelInSqlin interfaceDatabaseBuilder.Settings
-
isAutoLoadModuleInfo
Deprecated, for removal: This API element is subject to removal in a future version.- migrate toisLoadModuleInfo().- Specified by:
isAutoLoadModuleInfoin interfaceDatabaseBuilder.Settings
-
setLoadModuleInfo
- Specified by:
setLoadModuleInfoin interfaceDatabaseBuilder
-
includeLabelInSql
Description copied from interface:DatabaseBuilderSet 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:
includeLabelInSqlin interfaceDatabaseBuilder- Parameters:
includeLabelInSql- When true include a SQL inline comment in generated SELECT queries.
-
getMetricNaming
Description copied from interface:DatabaseBuilder.SettingsReturn the naming convention to apply to metrics names.- Specified by:
getMetricNamingin interfaceDatabaseBuilder.Settings
-
setMetricNaming
- Specified by:
setMetricNamingin interfaceDatabaseBuilder
-
getLengthCheck
Returns the length check mode.- Specified by:
getLengthCheckin interfaceDatabaseBuilder.Settings
-
lengthCheck
Description copied from interface:DatabaseBuilderSets the length check mode.- Specified by:
lengthCheckin interfaceDatabaseBuilder
-
classes().