public abstract class JdbcSnapshotGenerator extends Object implements SnapshotGenerator
PRIORITY_ADDITIONAL, PRIORITY_DATABASE, PRIORITY_DEFAULT, PRIORITY_NONE
Modifier | Constructor and Description |
---|---|
protected |
JdbcSnapshotGenerator(Class<? extends DatabaseObject> defaultFor) |
protected |
JdbcSnapshotGenerator(Class<? extends DatabaseObject> defaultFor,
Class<? extends DatabaseObject>[] addsTo) |
Modifier and Type | Method and Description |
---|---|
void |
addStatusListener(DiffStatusListener listener) |
Class<? extends DatabaseObject>[] |
addsTo()
When snapshotting a certain object type (e.g.
|
protected abstract void |
addTo(DatabaseObject foundObject,
DatabaseSnapshot snapshot) |
protected String |
cleanNameFromDatabase(String objectName,
Database database) |
protected String[] |
getDatabaseCatalogNames(Database database)
Fetches an array of Strings with the catalog names in the database.
|
int |
getPriority(Class<? extends DatabaseObject> objectType,
Database database)
Inquire if this SnapshotGenerator is capable of snapshotting objects of type
objectType (e.g.
|
Class<? extends SnapshotGenerator>[] |
replaces()
Returns classes (and superclasses) that this SnapshotGenerator replaces.
|
protected boolean |
shouldAddTo(Class<? extends DatabaseObject> databaseObjectType,
DatabaseSnapshot snapshot) |
DatabaseObject |
snapshot(DatabaseObject example,
DatabaseSnapshot snapshot,
SnapshotGeneratorChain chain)
Commands the SnapshotGenerator to create a snapshot (a representation of a database object in Java object form)
of a specific database object.
|
protected abstract DatabaseObject |
snapshotObject(DatabaseObject example,
DatabaseSnapshot snapshot) |
protected void |
updateListeners(String message) |
protected JdbcSnapshotGenerator(Class<? extends DatabaseObject> defaultFor)
protected JdbcSnapshotGenerator(Class<? extends DatabaseObject> defaultFor, Class<? extends DatabaseObject>[] addsTo)
public int getPriority(Class<? extends DatabaseObject> objectType, Database database)
SnapshotGenerator
getPriority
in interface SnapshotGenerator
objectType
- The object type we are asked to snapshotdatabase
- The DBMS for which the snapshotting should be donepublic Class<? extends DatabaseObject>[] addsTo()
SnapshotGenerator
addsTo
in interface SnapshotGenerator
public DatabaseObject snapshot(DatabaseObject example, DatabaseSnapshot snapshot, SnapshotGeneratorChain chain) throws DatabaseException, InvalidExampleException
SnapshotGenerator
snapshot
in interface SnapshotGenerator
example
- The object we should try to snapshotsnapshot
- The Snapshot object representing the result of the snapshot operations so farchain
- A list of other SnapshotGenerators that might be asked to try the sameDatabaseException
- If an operation on the database failsInvalidExampleException
- If, for some reason, we cannot work on the example object (ambiguous naming etc.)protected boolean shouldAddTo(Class<? extends DatabaseObject> databaseObjectType, DatabaseSnapshot snapshot)
public Class<? extends SnapshotGenerator>[] replaces()
SnapshotGenerator
replaces
in interface SnapshotGenerator
protected abstract DatabaseObject snapshotObject(DatabaseObject example, DatabaseSnapshot snapshot) throws DatabaseException, InvalidExampleException
protected abstract void addTo(DatabaseObject foundObject, DatabaseSnapshot snapshot) throws DatabaseException, InvalidExampleException
public void addStatusListener(DiffStatusListener listener)
protected void updateListeners(String message)
protected String[] getDatabaseCatalogNames(Database database) throws SQLException, DatabaseException
database
- The database from which to get the schema namesSQLException
- propagated java.sql.SQLExceptionDatabaseException
- if a different problem occurs during the DBMS-specific codeCopyright © 2023 Liquibase.org. All rights reserved.