use of liquibase.diff.compare.DatabaseObjectComparatorFactory in project liquibase by liquibase.
the class DiffResult method getChangedObject.
public ObjectDifferences getChangedObject(DatabaseObject example, CompareControl.SchemaComparison[] schemaComparisons) {
Database accordingTo = this.getComparisonSnapshot().getDatabase();
DatabaseObjectComparatorFactory comparator = DatabaseObjectComparatorFactory.getInstance();
for (Map.Entry<? extends DatabaseObject, ObjectDifferences> entry : getChangedObjects(example.getClass()).entrySet()) {
if (comparator.isSameObject(entry.getKey(), example, schemaComparisons, accordingTo)) {
return entry.getValue();
}
}
return null;
}
use of liquibase.diff.compare.DatabaseObjectComparatorFactory in project liquibase by liquibase.
the class DiffResult method getUnexpectedObject.
public <T extends DatabaseObject> T getUnexpectedObject(T example, CompareControl.SchemaComparison[] schemaComparisons) {
Database accordingTo = this.getComparisonSnapshot().getDatabase();
DatabaseObjectComparatorFactory comparator = DatabaseObjectComparatorFactory.getInstance();
for (T obj : (Set<T>) getUnexpectedObjects(example.getClass())) {
if (comparator.isSameObject(obj, example, schemaComparisons, accordingTo)) {
return obj;
}
}
return null;
}
use of liquibase.diff.compare.DatabaseObjectComparatorFactory in project liquibase by liquibase.
the class DiffResult method getMissingObject.
public <T extends DatabaseObject> T getMissingObject(T example, CompareControl.SchemaComparison[] schemaComparisons) {
Database accordingTo = getComparisonSnapshot().getDatabase();
DatabaseObjectComparatorFactory comparator = DatabaseObjectComparatorFactory.getInstance();
for (T obj : (Set<T>) getMissingObjects(example.getClass())) {
if (comparator.isSameObject(obj, example, schemaComparisons, accordingTo)) {
return obj;
}
}
return null;
}
Aggregations