当前位置: 首页>>代码示例>>Java>>正文


Java ChangeLogHistoryService类代码示例

本文整理汇总了Java中liquibase.changelog.ChangeLogHistoryService的典型用法代码示例。如果您正苦于以下问题:Java ChangeLogHistoryService类的具体用法?Java ChangeLogHistoryService怎么用?Java ChangeLogHistoryService使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


ChangeLogHistoryService类属于liquibase.changelog包,在下文中一共展示了ChangeLogHistoryService类的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: shouldUpdate

import liquibase.changelog.ChangeLogHistoryService; //导入依赖的package包/类
/**
 * Returns {@code true} if the supplied {@link Liquibase} instance
 * should in fact have its {@link Liquibase#update(String)} method
 * called.
 *
 * <p>This implementation returns {@code true} if the {@code
 * liquibase.should.run} system property is non-{@code null} and set
 * to something other than {@code false} and if the supplied {@link
 * Liquibase} instance is non-{@code null} and {@linkplain
 * StandardChangeLogHistoryService#hasDatabaseChangeLogTable() is
 * connected to a database that does not yet have a
 * <code>DATABASECHANGELOG</code> table} in it.</p>
 *
 * @param liquibase the {@link Liquibase} instance to check; may be
 * {@code null} in which case {@code false} will be returned
 *
 * @return {@code true} if the supplied {@link Liquibase} instance
 * should in fact have its {@link Liquibase#update(String)} method
 * called
 *
 * @exception LiquibaseException if there was a Liquibase-related
 * error
 *
 * @exception SQLException if there was a database-related error
 *
 * @see Liquibase#update(String)
 */
protected boolean shouldUpdate(final Liquibase liquibase) throws LiquibaseException, SQLException {
  this.logger.debug("Entering shouldUpdate(Liquibase); parameters: liquibase = " + liquibase);
  boolean returnValue = liquibase != null && !"false".equals(System.getProperty("liquibase.should.run"));
  if (returnValue) {
    final Database database = liquibase.getDatabase();
    if (database != null) {
      final ChangeLogHistoryService changeLogHistoryService = ChangeLogHistoryServiceFactory.getInstance().getChangeLogService(database);
      returnValue = !(changeLogHistoryService instanceof StandardChangeLogHistoryService) || !((StandardChangeLogHistoryService)changeLogHistoryService).hasDatabaseChangeLogTable();
    }
  }
  this.logger.debug("Exiting shouldUpdate(Liquibase); returning: " + returnValue);
  return returnValue;
}
 
开发者ID:ljnelson,项目名称:liquiunit,代码行数:41,代码来源:LiquiunitRule.java


注:本文中的liquibase.changelog.ChangeLogHistoryService类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。