01: package liquibase.change.custom;
02:
03: import liquibase.FileOpener;
04: import liquibase.database.Database;
05: import liquibase.database.sql.SqlStatement;
06: import liquibase.database.sql.StoredProcedureStatement;
07: import liquibase.database.structure.DatabaseObject;
08: import liquibase.exception.SetupException;
09: import liquibase.exception.UnsupportedChangeException;
10:
11: import java.util.Set;
12:
13: public class ExampleCustomProcCallChange implements CustomSqlChange {
14:
15: private String procedureName;
16:
17: @SuppressWarnings({"UnusedDeclaration","FieldCanBeLocal"})
18: private FileOpener fileOpener;
19:
20: public String getProcedureName() {
21: return procedureName;
22: }
23:
24: public void setProcedureName(String procedureName) {
25: this .procedureName = procedureName;
26: }
27:
28: public SqlStatement[] generateStatements(Database database)
29: throws UnsupportedChangeException {
30: StoredProcedureStatement procedureStatement = new StoredProcedureStatement(
31: "testHello");
32: return new SqlStatement[] { procedureStatement, };
33: }
34:
35: public String getConfirmationMessage() {
36: return "Executed " + getProcedureName();
37: }
38:
39: public void setUp() throws SetupException {
40: }
41:
42: public Set<DatabaseObject> getAffectedDatabaseObjects() {
43: return null;
44: }
45:
46: public void setFileOpener(FileOpener fileOpener) {
47: this.fileOpener = fileOpener;
48: }
49: }
|