open class EmbeddedDatabaseFactoryBean : EmbeddedDatabaseFactory, FactoryBean<DataSource>, InitializingBean, DisposableBean
A subclass of EmbeddedDatabaseFactory that implements FactoryBean for registration as a Spring bean. Returns the actual DataSource that provides connectivity to the embedded database to Spring.
The target DataSource is returned instead of an EmbeddedDatabase proxy since the FactoryBean will manage the initialization and destruction lifecycle of the embedded database instance.
Implements DisposableBean to shutdown the embedded database when the managing Spring container is being closed.
Author
Keith Donald
Author
Juergen Hoeller
Since
3.0
EmbeddedDatabaseFactoryBean()
A subclass of EmbeddedDatabaseFactory that implements FactoryBean for registration as a Spring bean. Returns the actual DataSource that provides connectivity to the embedded database to Spring. The target DataSource is returned instead of an EmbeddedDatabase proxy since the FactoryBean will manage the initialization and destruction lifecycle of the embedded database instance. Implements DisposableBean to shutdown the embedded database when the managing Spring container is being closed. |
static val DEFAULT_DATABASE_NAME: String
Default name for an embedded database: {@value} |
open fun afterPropertiesSet(): Unit |
|
open fun destroy(): Unit |
|
open fun getObject(): DataSource |
|
open fun getObjectType(): Class<out DataSource> |
|
open fun isSingleton(): Boolean |
|
open fun setDatabaseCleaner(databaseCleaner: DatabasePopulator): Unit
Set a script execution to be run in the bean destruction callback, cleaning up the database and leaving it in a known state for others. |
open fun getDatabase(): EmbeddedDatabase
Factory method that returns the EmbeddedDatabase instance, which is also a DataSource. |
|
open fun setDataSourceFactory(dataSourceFactory: DataSourceFactory): Unit
Set the factory to use to create the DataSource instance that connects to the embedded database. Defaults to SimpleDriverDataSourceFactory. |
|
open fun setDatabaseConfigurer(configurer: EmbeddedDatabaseConfigurer): Unit
Set the strategy that will be used to configure the embedded database instance. Call this when you wish to use an embedded database type not already supported. |
|
open fun setDatabaseName(databaseName: String): Unit
Set the name of the database. Defaults to {@value #DEFAULT_DATABASE_NAME}. Will be overridden if the |
|
open fun setDatabasePopulator(populator: DatabasePopulator): Unit
Set the strategy that will be used to initialize or populate the embedded database. Defaults to |
|
open fun setDatabaseType(type: EmbeddedDatabaseType): Unit
Set the type of embedded database to use. Call this when you wish to configure one of the pre-supported types. Defaults to HSQL. |
|
open fun setGenerateUniqueDatabaseName(generateUniqueDatabaseName: Boolean): Unit
Set the Setting this flag to |