类 AbstractScriptDatabaseInitializer

java.lang.Object
org.springframework.boot.sql.init.AbstractScriptDatabaseInitializer
所有已实现的接口:
Aware, InitializingBean, ResourceLoaderAware
直接已知子类:
DataSourceScriptDatabaseInitializer, R2dbcScriptDatabaseInitializer

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
  • 构造器详细资料

  • 方法详细资料

    • setResourceLoader

      public void setResourceLoader(ResourceLoader resourceLoader)
      指定者:
      setResourceLoader 在接口中 ResourceLoaderAware
    • afterPropertiesSet

      public void afterPropertiesSet() throws Exception
      指定者:
      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, otherwise false
    • isEmbeddedDatabase

      protected boolean isEmbeddedDatabase()
      Returns whether the database that is to be initialized is embedded.
      返回:
      true if the database is embedded, otherwise false
      从以下版本开始:
      2.5.1
    • runScripts

      protected abstract void runScripts(AbstractScriptDatabaseInitializer.Scripts scripts)
      Initialize the database by running the given scripts.
      参数:
      scripts - the scripts to run
      从以下版本开始:
      3.0.0