Top Fields Methods
liquibase.snapshot

public Interface SnapshotGenerator

Known Direct Implementers
liquibase.snapshot.jvm.JdbcSnapshotGenerator
Imports
liquibase.database.Database, liquibase.exception.DatabaseException, liquibase.structure.DatabaseObject

Field Summary

Modifier and TypeField and Description
public static final int
public static final int
public static final int
public static final int

Method Summary

Modifier and TypeMethod and Description
public Class<? extends DatabaseObject>[]

Returns:

an array of classes that this SnapshotGenerator might return upon snapshotting a given DatabaseObject type.
addsTo
()

When snapshotting a certain object type (e.g. a table), different types of objects might be discovered in the process.

public int

Returns:

An integer of PRIORITY_... constants indicating our capability and willingness to snapshot
getPriority
(Class<? extends DatabaseObject>
The object type we are asked to snapshot
objectType
,
Database
The DBMS for which the snapshotting should be done
database
)

Inquire if this SnapshotGenerator is capable of snapshotting objects of type objectType (e.g. Table, Index, View etc.) in the DBMS database (e.g. Oracle, Postgres, HyperSQL etc.) A return priority of > 0 will be interpreted as capable.

public Class<? extends SnapshotGenerator>[]
replaces()

Returns classes (and superclasses) that this SnapshotGenerator replaces.

public <
The Java object type in which we are to return the snapshot result
T extends DatabaseObject
>
T

Returns:

An object of type T if our snapshot attempt is successful
snapshot
(T
The object we should try to snapshot
example
,
DatabaseSnapshot
The Snapshot object representing the result of the snapshot operations so far
snapshot
,
SnapshotGeneratorChain
A list of other SnapshotGenerators that might be asked to try the same
chain
)

Commands the SnapshotGenerator to create a snapshot (a representation of a database object in Java object form) of a specific database object.

Field Detail

PRIORITY_ADDITIONALback to summary
public static final int PRIORITY_ADDITIONAL
PRIORITY_DATABASEback to summary
public static final int PRIORITY_DATABASE
PRIORITY_DEFAULTback to summary
public static final int PRIORITY_DEFAULT
PRIORITY_NONEback to summary
public static final int PRIORITY_NONE

Method Detail

addsToback to summary
public Class<? extends DatabaseObject>[] addsTo()

When snapshotting a certain object type (e.g. a table), different types of objects might be discovered in the process. (TODO: Which ones? Needs a more precise description.)

Returns:Class<? extends DatabaseObject>[]

an array of classes that this SnapshotGenerator might return upon snapshotting a given DatabaseObject type.

getPriorityback to summary
public int getPriority(Class<? extends DatabaseObject> objectType, Database database)

Inquire if this SnapshotGenerator is capable of snapshotting objects of type objectType (e.g. Table, Index, View etc.) in the DBMS database (e.g. Oracle, Postgres, HyperSQL etc.) A return priority of > 0 will be interpreted as capable. The highest priority for an objectType-database combination wins.

Parameters
objectType:Class<? extends DatabaseObject>

The object type we are asked to snapshot

database:Database

The DBMS for which the snapshotting should be done

Returns:int

An integer of PRIORITY_... constants indicating our capability and willingness to snapshot

replacesback to summary
public Class<? extends SnapshotGenerator>[] replaces()

Returns classes (and superclasses) that this SnapshotGenerator replaces. Return null or empty array to not affect the SnapshotGeneratorChain.

snapshotback to summary
public <T extends DatabaseObject> T snapshot(T example, DatabaseSnapshot snapshot, SnapshotGeneratorChain chain) throws DatabaseException, InvalidExampleException

Commands the SnapshotGenerator to create a snapshot (a representation of a database object in Java object form) of a specific database object.

Parameters
<T>
The Java object type in which we are to return the snapshot result
example:T

The object we should try to snapshot

snapshot:DatabaseSnapshot

The Snapshot object representing the result of the snapshot operations so far

chain:SnapshotGeneratorChain

A list of other SnapshotGenerators that might be asked to try the same

Returns:T

An object of type T if our snapshot attempt is successful

Exceptions
DatabaseException:
If an operation on the database fails
InvalidExampleException:
If, for some reason, we cannot work on the example object (ambiguous naming etc.)