Package liquibase.snapshot
Class SnapshotGeneratorFactory
java.lang.Object
liquibase.snapshot.SnapshotGeneratorFactory
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncreateSnapshot(CatalogAndSchema[] examples, Database database, SnapshotControl snapshotControl) Creates a database snapshot for a given array of catalog/schema combinations.createSnapshot(CatalogAndSchema example, Database database, SnapshotControl snapshotControl) createSnapshot(DatabaseObject[] examples, Database database, SnapshotControl snapshotControl) Creates a database snapshot for a given array of DatabaseObjects<T extends DatabaseObject>
TcreateSnapshot(T example, Database database) Creates a DatabaseSnapshot for a single DatabaseObject.<T extends DatabaseObject>
TcreateSnapshot(T example, Database database, SnapshotControl snapshotControl) Creates a DatabaseSnapshot for a single DatabaseObject.Set<Class<? extends DatabaseObject>>getContainerTypes(Class<? extends DatabaseObject> type, Database database) getDatabaseChangeLogLockTable(Database database) getDatabaseChangeLogTable(SnapshotControl snapshotControl, Database database) protected SortedSet<SnapshotGenerator>getGenerators(Class<? extends DatabaseObject> generatorClass, Database database) static SnapshotGeneratorFactoryReturn singleton SnapshotGeneratorFactorybooleanhas(DatabaseObject example, Database database) Checks if a specific object is present in a databasebooleanhasDatabaseChangeLogLockTable(Database database) booleanhasDatabaseChangeLogTable(Database database) booleanhasIgnoreNested(DatabaseObject example, Database database) Checks if a specific object is present in a database.voidregister(SnapshotGenerator generator) static voidreset()static voidresetAll()voidunregister(Class generatorClass) voidunregister(SnapshotGenerator generator)
-
Field Details
-
SUPPORTS_METHOD_REQUIRED_MESSAGE
- See Also:
-
-
Constructor Details
-
SnapshotGeneratorFactory
protected SnapshotGeneratorFactory()
-
-
Method Details
-
getInstance
Return singleton SnapshotGeneratorFactory -
reset
public static void reset() -
resetAll
public static void resetAll() -
register
-
unregister
-
unregister
-
getGenerators
protected SortedSet<SnapshotGenerator> getGenerators(Class<? extends DatabaseObject> generatorClass, Database database) -
has
public boolean has(DatabaseObject example, Database database) throws DatabaseException, InvalidExampleException Checks if a specific object is present in a database- Parameters:
example- The DatabaseObject to check for existencedatabase- The DBMS in which the object might exist- Returns:
- true if object exists, false otherwise
- Throws:
DatabaseException- If a problem occurs in the DBMS-specific codeInvalidExampleException- If the object cannot be checked properly, e.g. if the object name is ambiguous
-
hasIgnoreNested
public boolean hasIgnoreNested(DatabaseObject example, Database database) throws DatabaseException, InvalidExampleException Checks if a specific object is present in a database. When using this method the database snapshot will NOT search through nested objects.- Parameters:
example- The DatabaseObject to check for existencedatabase- The DBMS in which the object might exist- Returns:
- true if object exists, false otherwise
- Throws:
DatabaseException- If a problem occurs in the DBMS-specific codeInvalidExampleException- If the object cannot be checked properly, e.g. if the object name is ambiguous
-
createSnapshot
public DatabaseSnapshot createSnapshot(CatalogAndSchema example, Database database, SnapshotControl snapshotControl) throws DatabaseException, InvalidExampleException -
createSnapshot
public DatabaseSnapshot createSnapshot(CatalogAndSchema[] examples, Database database, SnapshotControl snapshotControl) throws DatabaseException, InvalidExampleException Creates a database snapshot for a given array of catalog/schema combinations.- Parameters:
examples- an array of CatalogAndSchema objectsdatabase- the database to work onsnapshotControl- the options/settings for snapshot generation- Returns:
- a database snapshot that includes all objects matching the specification
- Throws:
DatabaseException- if a problem occurs during snapshottingInvalidExampleException- if the given catalog/schema combinations are invalid (e.g. duplicates)
-
createSnapshot
public DatabaseSnapshot createSnapshot(DatabaseObject[] examples, Database database, SnapshotControl snapshotControl) throws DatabaseException, InvalidExampleException Creates a database snapshot for a given array of DatabaseObjects- Parameters:
examples- an array of DatabaseObjects objectsdatabase- the database to work onsnapshotControl- the options/settings for snapshot generation- Returns:
- a database snapshot that includes all objects matching the specification
- Throws:
DatabaseException- if a problem occurs during snapshottingInvalidExampleException- if the given catalog/schema combinations are invalid (e.g. duplicates)
-
createSnapshot
public <T extends DatabaseObject> T createSnapshot(T example, Database database) throws DatabaseException, InvalidExampleException Creates a DatabaseSnapshot for a single DatabaseObject.- Type Parameters:
T- the type of the object (must extend DatabaseObject)- Parameters:
example- the object to snapshotdatabase- the database to work on- Returns:
- the snapshot of the desired object
- Throws:
DatabaseException- if a problem occurs during snapshottingInvalidExampleException- if the given catalog/schema combinations are invalid (e.g. duplicates)
-
createSnapshot
public <T extends DatabaseObject> T createSnapshot(T example, Database database, SnapshotControl snapshotControl) throws DatabaseException, InvalidExampleException Creates a DatabaseSnapshot for a single DatabaseObject.- Type Parameters:
T- the type of the object (must extend DatabaseObject)- Parameters:
example- the object to snapshotdatabase- the database to work onsnapshotControl- the options/settings for snapshot generation- Returns:
- the snapshot of the desired object
- Throws:
DatabaseException- if a problem occurs during snapshottingInvalidExampleException- if the given catalog/schema combinations are invalid (e.g. duplicates)
-
getDatabaseChangeLogTable
public Table getDatabaseChangeLogTable(SnapshotControl snapshotControl, Database database) throws DatabaseException - Throws:
DatabaseException
-
getDatabaseChangeLogLockTable
- Throws:
DatabaseException
-
hasDatabaseChangeLogTable
- Throws:
DatabaseException
-
hasDatabaseChangeLogLockTable
- Throws:
DatabaseException
-
getContainerTypes
public Set<Class<? extends DatabaseObject>> getContainerTypes(Class<? extends DatabaseObject> type, Database database)
-