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


Java DiffResult.printChangeLog方法代码示例

本文整理汇总了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);
    }
}
 
开发者ID:hongliangpan,项目名称:manydesigns.cn,代码行数:18,代码来源:CommandLineUtils.java

示例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);
    }
}
 
开发者ID:hongliangpan,项目名称:manydesigns.cn,代码行数:15,代码来源:CommandLineUtils.java

示例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);
    }
}
 
开发者ID:hongliangpan,项目名称:manydesigns.cn,代码行数:9,代码来源:DiffDatabaseToChangeLogTask.java

示例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);
		}
	}
 
开发者ID:hongliangpan,项目名称:manydesigns.cn,代码行数:37,代码来源:GenerateChangeLogTask.java


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