本文整理汇总了Java中liquibase.diff.DiffResult.printChangeLog方法的典型用法代码示例。如果您正苦于以下问题:Java DiffResult.printChangeLog方法的具体用法?Java DiffResult.printChangeLog怎么用?Java DiffResult.printChangeLog使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类liquibase.diff.DiffResult
的用法示例。
在下文中一共展示了DiffResult.printChangeLog方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: doGenerateChangeLog
import liquibase.diff.DiffResult; //导入方法依赖的package包/类
public static void doGenerateChangeLog(String changeLogFile, Database originalDatabase, String defaultSchemaName, String diffTypes, String author, String context, String dataDir) throws DatabaseException, IOException, ParserConfigurationException {
Diff diff = new Diff(originalDatabase, defaultSchemaName);
diff.setDiffTypes(diffTypes);
diff.addStatusListener(new OutDiffStatusListener());
DiffResult diffResult = diff.compare();
diffResult.setChangeSetAuthor(author);
diffResult.setChangeSetContext(context);
diffResult.setDataDir(dataDir);
if (StringUtils.trimToNull(changeLogFile) != null) {
diffResult.printChangeLog(changeLogFile, originalDatabase);
} else {
PrintStream outputStream = System.out;
diffResult.printChangeLog(outputStream, originalDatabase);
}
}
示例2: doDiffToChangeLog
import liquibase.diff.DiffResult; //导入方法依赖的package包/类
public static void doDiffToChangeLog(String changeLogFile,
Database referenceDatabase,
Database targetDatabase)
throws DatabaseException, IOException, ParserConfigurationException {
Diff diff = new Diff(referenceDatabase, targetDatabase);
diff.addStatusListener(new OutDiffStatusListener());
DiffResult diffResult = diff.compare();
if (changeLogFile == null) {
diffResult.printChangeLog(System.out, targetDatabase);
} else {
diffResult.printChangeLog(changeLogFile, targetDatabase);
}
}
示例3: outputDiff
import liquibase.diff.DiffResult; //导入方法依赖的package包/类
@Override
protected void outputDiff(PrintStream writer, DiffResult diffResult, Database targetDatabase) throws Exception {
if (getChangeLogFile() == null) {
diffResult.printChangeLog(writer, targetDatabase);
} else {
diffResult.printChangeLog(getChangeLogFile(), targetDatabase);
}
}
示例4: execute
import liquibase.diff.DiffResult; //导入方法依赖的package包/类
@Override
public void execute() throws BuildException {
super.execute();
Liquibase liquibase = null;
try {
PrintStream writer = createPrintStream();
if (writer == null) {
throw new BuildException("generateChangeLog requires outputFile to be set");
}
liquibase = createLiquibase();
Database database = liquibase.getDatabase();
Diff diff = new Diff(database, getDefaultSchemaName());
if (getDiffTypes() != null) {
diff.setDiffTypes(getDiffTypes());
}
// diff.addStatusListener(new OutDiffStatusListener());
DiffResult diffResult = diff.compare();
diffResult.setDataDir(getDataDir());
if (getChangeLogFile() == null) {
diffResult.printChangeLog(writer, database);
} else {
diffResult.printChangeLog(getChangeLogFile(), database);
}
writer.flush();
writer.close();
} catch (Exception e) {
throw new BuildException(e);
} finally {
closeDatabase(liquibase);
}
}