liquibase.Liquibase.validate()方法的使用及代码示例

x33g5p2x  于2022-01-23 转载在 其他  
字(6.6k)|赞(0)|评价(0)|浏览(267)

本文整理了Java中liquibase.Liquibase.validate()方法的一些代码示例,展示了Liquibase.validate()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Liquibase.validate()方法的具体详情如下:
包路径:liquibase.Liquibase
类名称:Liquibase
方法名:validate

Liquibase.validate介绍

暂无

代码示例

代码示例来源:origin: org.keycloak/keycloak-connections-jpa-liquibase

@Override
public void validate(Connection connection, String defaultSchema) {
  try {
    Liquibase liquibase = getLiquibase(connection, defaultSchema);
    liquibase.validate();
  } catch (Exception e) {
    throw new RuntimeException("Failed to validate database", e);
  }
}

代码示例来源:origin: com.blazebit/blaze-weblink-core-model

public void validate(Connection connection) {
  try {
    Liquibase liquibase = getLiquibase(connection);
    liquibase.validate();
  } catch (Exception e) {
    throw new RuntimeException("Failed to validate database", e);
  }
}

代码示例来源:origin: org.flowable/flowable-dmn-engine

public void initSchema(DmnEngineConfiguration dmnEngineConfiguration, String databaseSchemaUpdate) {
  Liquibase liquibase = null;
  try {
    liquibase = createLiquibaseInstance(dmnEngineConfiguration);
    if (DmnEngineConfiguration.DB_SCHEMA_UPDATE_DROP_CREATE.equals(databaseSchemaUpdate)) {
      LOGGER.debug("Dropping and creating schema DMN");
      liquibase.dropAll();
      liquibase.update("dmn");
    } else if (DmnEngineConfiguration.DB_SCHEMA_UPDATE_TRUE.equals(databaseSchemaUpdate)) {
      LOGGER.debug("Updating schema DMN");
      liquibase.update("dmn");
    } else if (DmnEngineConfiguration.DB_SCHEMA_UPDATE_FALSE.equals(databaseSchemaUpdate)) {
      LOGGER.debug("Validating schema DMN");
      liquibase.validate();
    }
  } catch (Exception e) {
    throw new FlowableException("Error initialising dmn data model", e);
  } finally {
    closeDatabase(liquibase);
  }
}

代码示例来源:origin: org.flowable/flowable-content-engine

public void initSchema(ContentEngineConfiguration configuration, String databaseSchemaUpdate) {
  Liquibase liquibase = null;
  try {
    liquibase = createLiquibaseInstance(configuration);
    if (ContentEngineConfiguration.DB_SCHEMA_UPDATE_DROP_CREATE.equals(databaseSchemaUpdate)) {
      LOGGER.debug("Dropping and creating schema Content");
      liquibase.dropAll();
      liquibase.update("content");
    } else if (ContentEngineConfiguration.DB_SCHEMA_UPDATE_TRUE.equals(databaseSchemaUpdate)) {
      LOGGER.debug("Updating schema Content");
      liquibase.update("content");
    } else if (ContentEngineConfiguration.DB_SCHEMA_UPDATE_FALSE.equals(databaseSchemaUpdate)) {
      LOGGER.debug("Validating schema Content");
      liquibase.validate();
    }
  } catch (Exception e) {
    throw new FlowableException("Error initialising Content schema", e);
  } finally {
    closeDatabase(liquibase);
  }
}

代码示例来源:origin: org.flowable/flowable-form-engine

public void initSchema(FormEngineConfiguration formEngineConfiguration) {
  Liquibase liquibase = null;
  try {
    liquibase = createLiquibaseInstance(formEngineConfiguration);
    String databaseSchemaUpdate = formEngineConfiguration.getDatabaseSchemaUpdate();
    if (FormEngineConfiguration.DB_SCHEMA_UPDATE_DROP_CREATE.equals(databaseSchemaUpdate)) {
      LOGGER.debug("Dropping and creating schema FORM");
      liquibase.dropAll();
      liquibase.update("form");
    } else if (FormEngineConfiguration.DB_SCHEMA_UPDATE_TRUE.equals(databaseSchemaUpdate)) {
      LOGGER.debug("Updating schema FORM");
      liquibase.update("form");
    } else if (FormEngineConfiguration.DB_SCHEMA_UPDATE_FALSE.equals(databaseSchemaUpdate)) {
      LOGGER.debug("Validating schema FORM");
      liquibase.validate();
    }
  } catch (Exception e) {
    throw new FlowableException("Error initialising form data schema", e);
  } finally {
    closeDatabase(liquibase);
  }
}

代码示例来源:origin: org.flowable/flowable-dmn-engine

@Override
public void schemaCheckVersion() {
  Liquibase liquibase = null;
  try {
    liquibase = createLiquibaseInstance(CommandContextUtil.getDmnEngineConfiguration());
    liquibase.validate();
  } catch (Exception e) {
    throw new FlowableException("Error validating app engine schema", e);
  } finally {
    closeDatabase(liquibase);
  }
}

代码示例来源:origin: org.flowable/flowable-form-engine

@Override
public void schemaCheckVersion() {
  Liquibase liquibase = null;
  try {
    liquibase = createLiquibaseInstance(CommandContextUtil.getFormEngineConfiguration());
    liquibase.validate();
  } catch (Exception e) {
    throw new FlowableException("Error validating app engine schema", e);
  } finally {
    closeDatabase(liquibase);
  }
}

代码示例来源:origin: org.flowable/flowable-cmmn-engine

@Override
public void schemaCheckVersion() {
  Liquibase liquibase = null;
  try {
    liquibase = createLiquibaseInstance(CommandContextUtil.getCmmnEngineConfiguration());
    liquibase.validate();
  } catch (Exception e) {
    throw new FlowableException("Error validating app engine schema", e);
  } finally {
    closeDatabase(liquibase);
  }
}

代码示例来源:origin: org.flowable/flowable-content-engine

@Override
public void schemaCheckVersion() {
  Liquibase liquibase = null;
  try {
    liquibase = createLiquibaseInstance(CommandContextUtil.getContentEngineConfiguration());
    liquibase.validate();
  } catch (Exception e) {
    throw new FlowableException("Error validating app engine schema", e);
  } finally {
    closeDatabase(liquibase);
  }
}

代码示例来源:origin: org.flowable/flowable-app-engine

@Override
public void schemaCheckVersion() {
  Liquibase liquibase = null;
  try {
    liquibase = createLiquibaseInstance(CommandContextUtil.getAppEngineConfiguration());
    liquibase.validate();
  } catch (Exception e) {
    throw new FlowableException("Error validating app engine schema", e);
  } finally {
    closeDatabase(liquibase);
  }
}

代码示例来源:origin: stackoverflow.com

public void verify(DataSource ds) {
   boolean throwException = false;
   Contexts contexts = new Contexts("");
   for(LiquibaseConfiguration c : configs) {
     try(Connection con = ds.getConnection()) {
         Database db = DatabaseFactory.getInstance().findCorrectDatabaseImplementation(new JdbcConnection(con));
         db.setDatabaseChangeLogLockTableName(c.changeLogLockTableName());
         db.setDatabaseChangeLogTableName(c.changeLogTableName());
         Liquibase liquibase = new ShureviewNonCreationLiquibase(c.liquibaseResource(), new ClassLoaderResourceAccessor(), db);
         liquibase.getLog();
         liquibase.validate();
         List<ChangeSet> listUnrunChangeSets = liquibase.listUnrunChangeSets(contexts, new LabelExpression());
         if(!listUnrunChangeSets.isEmpty()) {
           StringWriter writer = new StringWriter();
           liquibase.update(contexts, writer);
           liquibase.futureRollbackSQL(writer);
           log.warn(writer.toString());
           throwException = true;
         }
     } catch (SQLException | LiquibaseException e) {
       throw new RuntimeException("Failed to verify database.", e);
     }
   }
   if(throwException){
     throw new RuntimeException("Unrun changesets in chengelog.");
   }
 }

代码示例来源:origin: stackoverflow.com

Liquibase liquibase = new ShureviewNonCreationLiquibase(c.liquibaseResource(), new ClassLoaderResourceAccessor(), db);
liquibase.getLog();
liquibase.validate();
List<ChangeSet> listUnrunChangeSets = liquibase.listUnrunChangeSets(contexts, new LabelExpression());

相关文章