當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。