Class R2dbcScriptDatabaseInitializer
java.lang.Object
org.springframework.boot.sql.init.AbstractScriptDatabaseInitializer
org.springframework.boot.r2dbc.init.R2dbcScriptDatabaseInitializer
- All Implemented Interfaces:
org.springframework.beans.factory.Aware
,org.springframework.beans.factory.InitializingBean
,org.springframework.context.ResourceLoaderAware
An
InitializingBean
that initializes a database represented by an R2DBC
ConnectionFactory
.- Since:
- 2.5.0
-
Nested Class Summary
Nested classes/interfaces inherited from class org.springframework.boot.sql.init.AbstractScriptDatabaseInitializer
AbstractScriptDatabaseInitializer.Scripts
-
Constructor Summary
ConstructorDescriptionR2dbcScriptDatabaseInitializer
(io.r2dbc.spi.ConnectionFactory connectionFactory, DatabaseInitializationSettings settings) Creates a newR2dbcScriptDatabaseInitializer
that will initialize the database recognized by the givenconnectionFactory
using the givensettings
. -
Method Summary
Modifier and TypeMethodDescriptionprotected boolean
Returns whether the database that is to be initialized is embedded.protected void
Initialize the database by running the givenscripts
.Methods inherited from class org.springframework.boot.sql.init.AbstractScriptDatabaseInitializer
afterPropertiesSet, initializeDatabase, setResourceLoader
-
Constructor Details
-
R2dbcScriptDatabaseInitializer
public R2dbcScriptDatabaseInitializer(io.r2dbc.spi.ConnectionFactory connectionFactory, DatabaseInitializationSettings settings) Creates a newR2dbcScriptDatabaseInitializer
that will initialize the database recognized by the givenconnectionFactory
using the givensettings
.- Parameters:
connectionFactory
- connectionFactory for the databasesettings
- initialization settings
-
-
Method Details
-
isEmbeddedDatabase
protected boolean isEmbeddedDatabase()Description copied from class:AbstractScriptDatabaseInitializer
Returns whether the database that is to be initialized is embedded.- Overrides:
isEmbeddedDatabase
in classAbstractScriptDatabaseInitializer
- Returns:
true
if the database is embedded, otherwisefalse
-
runScripts
Description copied from class:AbstractScriptDatabaseInitializer
Initialize the database by running the givenscripts
.- Specified by:
runScripts
in classAbstractScriptDatabaseInitializer
- Parameters:
scripts
- the scripts to run
-