public class DatabaseConfig extends ServerConfig
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 serverConfig 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 ServerConfigProvider provides a standard Java ServiceLoader mechanism that can be used to apply configuration to the DatabaseConfig.
DatabaseFactory
ServerConfig.UuidVersion
Constructor and Description |
---|
DatabaseConfig() |
add, add, add, add, add, add, add, addClass, addCustomMapping, addCustomMapping, addMappingLocation, addPackage, addServerConfigStartup, appliedPersistBatchOnCascade, getAsOfSysPeriod, getAsOfViewSuffix, getAutoTuneConfig, getBackgroundExecutorSchedulePoolSize, getBackgroundExecutorShutdownSecs, getBulkTableEventListeners, getCacheMaxIdleTime, getCacheMaxSize, getCacheMaxTimeToLive, getChangeLogListener, getChangeLogPrepare, getChangeLogRegister, getClasses, getClassLoadConfig, getClock, getConstraintNaming, getContainerConfig, getCurrentTenantProvider, getCurrentUserProvider, getDatabaseBooleanFalse, getDatabaseBooleanTrue, getDatabasePlatform, getDatabasePlatformName, getDatabaseSequenceBatchSize, getDataSource, getDataSourceConfig, getDataSourceJndiName, getDataTimeZone, getDbEncrypt, getDbSchema, getDdlInitSql, getDdlSeedSql, getDocStoreConfig, getEncryptDeployManager, getEncryptKeyManager, getEncryptor, getExternalTransactionManager, getFindControllers, getGeometrySRID, getHistoryTableSuffix, getIdGenerators, getIdType, getJdbcFetchSizeFindEach, getJdbcFetchSizeFindList, getJodaLocalTimeMode, getJsonDateTime, getJsonFactory, getJsonInclude, getLazyLoadBatchSize, getMappingLocations, getMaxCallStack, getMigrationConfig, getName, getNamingConvention, getObjectMapper, getPackages, getPersistBatch, getPersistBatchOnCascade, getPersistBatchSize, getPersistControllers, getPersistenceContextScope, getPersistListeners, getPlatformConfig, getPostConstructListeners, getPostLoaders, getProfilingConfig, getProperties, getQueryAdapters, getQueryBatchSize, getQueryCacheMaxIdleTime, getQueryCacheMaxSize, getQueryCacheMaxTimeToLive, getQueryPlanTTLSeconds, getReadAuditLogger, getReadAuditPrepare, getReadOnlyDataSource, getReadOnlyDataSourceConfig, getResourceDirectory, getServerCachePlugin, getServerConfigStartupListeners, getServiceObject, getServiceObject, getSlowQueryListener, getSlowQueryMillis, getTenantCatalogProvider, getTenantDataSourceProvider, getTenantMode, getTenantPartitionColumn, getTenantSchemaProvider, getUuidStateFile, getUuidVersion, isAllQuotedIdentifiers, isAutoCommitMode, isAutoReadOnlyDataSource, isChangeLogAsync, isChangeLogIncludeInserts, isCollectQueryOrigins, isCollectQueryPlans, isCollectQueryStatsByNode, isDbOffline, isDdlCreateOnly, isDdlExtra, isDdlGenerate, isDdlRun, isDefaultOrderById, isDefaultServer, isDisableClasspathSearch, isDisableL2Cache, isDisableLazyLoading, isDocStoreOnly, isDurationWithNanos, isEagerFetchLobs, isExplicitTransactionBeginMode, isExpressionEqualsWithNullAsNoop, isExpressionNativeIlike, isIdGeneratorAutomatic, isLocalTimeWithNanos, isNotifyL2CacheInForeground, isRegister, isSkipCacheAfterWrite, isTransactionRollbackOnChecked, isUpdateAllPropertiesInBatch, isUpdateChangesOnly, isUpdatesDeleteMissingChildren, isUseJavaxValidationNotNull, isUseJtaTransactionManager, loadFromProperties, loadFromProperties, newPlatformConfig, putServiceObject, putServiceObject, runDbMigration, service, serviceLoad, setAllQuotedIdentifiers, setAsOfSysPeriod, setAsOfViewSuffix, setAutoCommitMode, setAutoReadOnlyDataSource, setAutoTuneConfig, setBackgroundExecutorSchedulePoolSize, setBackgroundExecutorShutdownSecs, setCacheMaxIdleTime, setCacheMaxSize, setCacheMaxTimeToLive, setChangeLogAsync, setChangeLogIncludeInserts, setChangeLogListener, setChangeLogPrepare, setChangeLogRegister, setClasses, setClassLoadConfig, setClock, setCollectQueryOrigins, setCollectQueryPlans, setCollectQueryStatsByNode, setConstraintNaming, setContainerConfig, setCurrentTenantProvider, setCurrentUserProvider, setDatabaseBooleanFalse, setDatabaseBooleanTrue, setDatabasePlatform, setDatabasePlatformName, setDatabaseSequenceBatch, setDatabaseSequenceBatchSize, setDataSource, setDataSourceConfig, setDataSourceJndiName, setDataTimeZone, setDbEncrypt, setDbOffline, setDbSchema, setDbUuid, setDdlCreateOnly, setDdlExtra, setDdlGenerate, setDdlInitSql, setDdlRun, setDdlSeedSql, setDefaultOrderById, setDefaultServer, setDisableClasspathSearch, setDisableL2Cache, setDisableLazyLoading, setDocStoreConfig, setDocStoreOnly, setDurationWithNanos, setEagerFetchLobs, setEncryptDeployManager, setEncryptKeyManager, setEncryptor, setExplicitTransactionBeginMode, setExpressionEqualsWithNullAsNoop, setExpressionNativeIlike, setExternalTransactionManager, setFindControllers, setGeometrySRID, setHistoryTableSuffix, setIdGeneratorAutomatic, setIdGenerators, setIdType, setJdbcFetchSizeFindEach, setJdbcFetchSizeFindList, setJodaLocalTimeMode, setJsonDateTime, setJsonFactory, setJsonInclude, setLazyLoadBatchSize, setLocalTimeWithNanos, setMappingLocations, setMaxCallStack, setMigrationConfig, setName, setNamingConvention, setNotifyL2CacheInForeground, setObjectMapper, setPackages, setPersistBatch, setPersistBatching, setPersistBatchOnCascade, setPersistBatchSize, setPersistControllers, setPersistenceContextScope, setPersistListeners, setPlatformConfig, setPostConstructListeners, setPostLoaders, setProfilingConfig, setQueryAdapters, setQueryBatchSize, setQueryCacheMaxIdleTime, setQueryCacheMaxSize, setQueryCacheMaxTimeToLive, setQueryPlanTTLSeconds, setReadAuditLogger, setReadAuditPrepare, setReadOnlyDataSource, setReadOnlyDataSourceConfig, setRegister, setResourceDirectory, setRunMigration, setServerCachePlugin, setSkipCacheAfterWrite, setSlowQueryListener, setSlowQueryMillis, setTenantCatalogProvider, setTenantDataSourceProvider, setTenantMode, setTenantPartitionColumn, setTenantSchemaProvider, setTransactionRollbackOnChecked, setUpdateAllPropertiesInBatch, setUpdateChangesOnly, setUpdatesDeleteMissingChildren, setUseJavaxValidationNotNull, setUseJtaTransactionManager, setUuidStateFile, setUuidVersion
public DatabaseConfig()
Copyright © 2019. All rights reserved.