Package liquibase.diff.compare.core
Class DefaultDatabaseObjectComparator
java.lang.Object
liquibase.diff.compare.core.DefaultDatabaseObjectComparator
- All Implemented Interfaces:
DatabaseObjectComparator
public final class DefaultDatabaseObjectComparator
extends Object
implements DatabaseObjectComparator
-
Field Summary
Fields inherited from interface liquibase.diff.compare.DatabaseObjectComparator
PRIORITY_DATABASE, PRIORITY_DEFAULT, PRIORITY_NONE, PRIORITY_TYPE
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic boolean
compareObjectNames
(Database accordingTo, String object1Name, String object2Name) findDifferences
(DatabaseObject databaseObject1, DatabaseObject databaseObject2, Database accordingTo, CompareControl compareControl, DatabaseObjectComparatorChain chain, Set<String> exclude) int
getPriority
(Class<? extends DatabaseObject> objectType, Database database) String[]
hash
(DatabaseObject databaseObject, Database accordingTo, DatabaseObjectComparatorChain chain) boolean
isSameObject
(DatabaseObject databaseObject1, DatabaseObject databaseObject2, Database accordingTo, DatabaseObjectComparatorChain chain) static boolean
nameMatches
(DatabaseObject databaseObject1, DatabaseObject databaseObject2, Database accordingTo) protected Object
undoCollection
(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
-
DefaultDatabaseObjectComparator
public DefaultDatabaseObjectComparator()
-
-
Method Details
-
getPriority
- Specified by:
getPriority
in interfaceDatabaseObjectComparator
-
hash
public String[] hash(DatabaseObject databaseObject, Database accordingTo, DatabaseObjectComparatorChain chain) - Specified by:
hash
in interfaceDatabaseObjectComparator
-
isSameObject
public boolean isSameObject(DatabaseObject databaseObject1, DatabaseObject databaseObject2, Database accordingTo, DatabaseObjectComparatorChain chain) - Specified by:
isSameObject
in interfaceDatabaseObjectComparator
-
findDifferences
public ObjectDifferences findDifferences(DatabaseObject databaseObject1, DatabaseObject databaseObject2, Database accordingTo, CompareControl compareControl, DatabaseObjectComparatorChain chain, Set<String> exclude) - Specified by:
findDifferences
in interfaceDatabaseObjectComparator
-
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. -
nameMatches
public static boolean nameMatches(DatabaseObject databaseObject1, DatabaseObject databaseObject2, Database accordingTo) -
compareObjectNames
-