类 AbstractScriptDatabaseInitializer
java.lang.Object
org.springframework.boot.sql.init.AbstractScriptDatabaseInitializer
- 所有已实现的接口:
Aware
,InitializingBean
,ResourceLoaderAware
public abstract class AbstractScriptDatabaseInitializer
extends Object
implements ResourceLoaderAware, InitializingBean
Base class for an
InitializingBean
that performs SQL database initialization
using schema (DDL) and data (DML) scripts.- 从以下版本开始:
- 2.5.0
- 作者:
- Andy Wilkinson
-
嵌套类概要
嵌套类修饰符和类型类说明static class
Scripts to be used to initialize the database. -
构造器概要
构造器限定符构造器说明protected
Creates a newAbstractScriptDatabaseInitializer
that will initialize the database using the given settings. -
方法概要
修饰符和类型方法说明void
boolean
Initializes the database by applying schema and data scripts.protected boolean
Returns whether the database that is to be initialized is embedded.protected abstract void
Initialize the database by running the givenscripts
.void
setResourceLoader
(ResourceLoader resourceLoader)
-
构造器详细资料
-
AbstractScriptDatabaseInitializer
Creates a newAbstractScriptDatabaseInitializer
that will initialize the database using the given settings.- 参数:
settings
- initialization settings
-
-
方法详细资料
-
setResourceLoader
- 指定者:
setResourceLoader
在接口中ResourceLoaderAware
-
afterPropertiesSet
- 指定者:
afterPropertiesSet
在接口中InitializingBean
- 抛出:
Exception
-
initializeDatabase
public boolean initializeDatabase()Initializes the database by applying schema and data scripts.- 返回:
true
if one or more scripts were applied to the database, otherwisefalse
-
isEmbeddedDatabase
protected boolean isEmbeddedDatabase()Returns whether the database that is to be initialized is embedded.- 返回:
true
if the database is embedded, otherwisefalse
- 从以下版本开始:
- 2.5.1
-
runScripts
Initialize the database by running the givenscripts
.- 参数:
scripts
- the scripts to run- 从以下版本开始:
- 3.0.0
-