本文整理汇总了Java中liquibase.serializer.ChangeLogSerializer类的典型用法代码示例。如果您正苦于以下问题:Java ChangeLogSerializer类的具体用法?Java ChangeLogSerializer怎么用?Java ChangeLogSerializer使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
ChangeLogSerializer类属于liquibase.serializer包,在下文中一共展示了ChangeLogSerializer类的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: testChangeSets
import liquibase.serializer.ChangeLogSerializer; //导入依赖的package包/类
@Test
public void testChangeSets() throws Throwable {
String unitName = "StorageTestMasterOnly";
String changeLogPath = "META-INF/changelog/changelog-master.xml";
List<ChangeSet> changeSets = ChangeSetUtils.computeChangeSets(unitName, changeLogPath);
if (changeSets.size() > 0) {
ChangeLogSerializer changeLogSerializer = new XMLChangeLogSerializer();
changeLogSerializer.write(changeSets, System.out);
System.out.flush();
Assert.fail("There are data model changes which were not versioned!");
}
}
示例2: printChangeLog
import liquibase.serializer.ChangeLogSerializer; //导入依赖的package包/类
/**
* Prints changeLog that would bring the target database to be the same as
* the reference database
*/
public void printChangeLog(PrintStream out, Database targetDatabase,
ChangeLogSerializer changeLogSerializer)
throws ParserConfigurationException,
IOException, DatabaseException {
List<ChangeSet> changeSets = new ArrayList<ChangeSet>();
addMissingTableChanges(changeSets, targetDatabase);
addMissingColumnChanges(changeSets, targetDatabase);
addChangedColumnChanges(changeSets);
addMissingPrimaryKeyChanges(changeSets);
addUnexpectedPrimaryKeyChanges(changeSets);
addUnexpectedForeignKeyChanges(changeSets);
addMissingUniqueConstraintChanges(changeSets);
addUnexpectedUniqueConstraintChanges(changeSets);
if (diffData) {
addInsertDataChanges(changeSets, dataDir);
}
addMissingForeignKeyChanges(changeSets);
addUnexpectedIndexChanges(changeSets);
addMissingIndexChanges(changeSets);
addUnexpectedColumnChanges(changeSets);
addMissingSequenceChanges(changeSets);
addUnexpectedSequenceChanges(changeSets);
addMissingViewChanges(changeSets);
addUnexpectedViewChanges(changeSets);
addChangedViewChanges(changeSets);
addUnexpectedTableChanges(changeSets);
changeLogSerializer.write(changeSets, out);
out.flush();
}