Package liquibase.diff
Class ObjectDifferences
java.lang.Object
liquibase.diff.ObjectDifferences
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfacestatic classstatic classstatic classstatic classstatic classstatic class -
Constructor Summary
ConstructorsConstructorDescriptionObjectDifferences(CompareControl compareControl) Deprecated.ObjectDifferences(CompareControl compareControl, DatabaseObject referenceObject, DatabaseObject comparisonObject) Creates an ObjectDifferences with the control and both objects being compared. -
Method Summary
Modifier and TypeMethodDescriptionaddDifference(String changedField, Object referenceValue, Object compareToValue) addDifference(String message, String changedField, Object referenceValue, Object compareToValue) voidcompare(String message, String attribute, DatabaseObject referenceObject, DatabaseObject compareToObject, ObjectDifferences.CompareFunction compareFunction) voidcompare(String attribute, DatabaseObject referenceObject, DatabaseObject compareToObject, ObjectDifferences.CompareFunction compareFunction) Returns the comparison database object being compared.getDifference(String field) Returns the reference database object being compared.booleanbooleanisDifferent(String field) booleanremoveDifference(String attribute) protected ObjectundoCollection(Object potentialCollection, Object otherObject) Sometimes an attribute in one object is a single-entity collection and on the other it is just the object.
-
Constructor Details
-
ObjectDifferences
Deprecated.UseObjectDifferences(CompareControl, DatabaseObject, DatabaseObject)instead to provide both objects being comparedCreates an ObjectDifferences with only a CompareControl.- Parameters:
compareControl- the control to use for comparisons
-
ObjectDifferences
public ObjectDifferences(CompareControl compareControl, DatabaseObject referenceObject, DatabaseObject comparisonObject) Creates an ObjectDifferences with the control and both objects being compared.- Parameters:
compareControl- the control to use for comparisonsreferenceObject- the reference database object (can be null)comparisonObject- the comparison database object (can be null)
-
-
Method Details
-
getDifferences
-
getDifference
-
isDifferent
-
addDifference
public ObjectDifferences addDifference(String changedField, Object referenceValue, Object compareToValue) -
addDifference
public ObjectDifferences addDifference(String message, String changedField, Object referenceValue, Object compareToValue) -
hasDifferences
public boolean hasDifferences() -
compare
public void compare(String attribute, DatabaseObject referenceObject, DatabaseObject compareToObject, ObjectDifferences.CompareFunction compareFunction) -
compare
public void compare(String message, String attribute, DatabaseObject referenceObject, DatabaseObject compareToObject, ObjectDifferences.CompareFunction compareFunction) -
undoCollection
Sometimes an attribute in one object is a single-entity collection and on the other it is just the object. Check the passed potentialCollection and if it is a single-entry collection of the same type as the otherObject, return just the collection element. Otherwise, return the original collection. -
removeDifference
-
getSchemaComparisons
-
getReferenceObject
Returns the reference database object being compared.- Returns:
- the reference object, or null if not set
-
getComparisonObject
Returns the comparison database object being compared.- Returns:
- the comparison object, or null if not set
-
ObjectDifferences(CompareControl, DatabaseObject, DatabaseObject)instead to provide both objects being compared