Executing RawSqlStatement in changelog

Hi All,

I have the API as defined below :

 

public SqlStatement[] generateStatements(Database database)
                    throws UnsupportedChangeException {
                return new SqlStatement[] { new RawSqlStatement("update "
                        + tableName + " set " + columnName + " = " + newValue) };
            }

How to execute this “generateStatements” from liquibase changelog?

Thanks in advance,

-K

I’ve seen a few of your recent posts and I wasn’t quite sure what you were asking, but let me see if I got it.   Are you trying to programmatically invoke Liquibase by making method calls against the Liquibase object?  If so, I think what you want to do is, once you have constructed the Liquibase object with your changelog, then you want to call the update() method to have Liquibase run the change sets for you.


Thanks 
I am asking about the customChange liquibase.
I don't know how to invoke the method

generateStatements in changelog.

Thanks,
-K
Liquibase changelog
<customChange class="com.example.ExampleCustomChange"> <param name="tableName" value="person"/> <param name="columnName" value="employee_id"/>

Java class:

public class ExampleCustomSqlChange implements CustomSqlChange, CustomSqlRollback { private String tableName;

private String columnName;

private String newValue; @SuppressWarnings({“UnusedDeclaration”,“FieldCanBeLocal”})

private FileOpener fileOpener; public String getTableName() {

return tableName; } public void setTableName(String tableName) {

this .tableName = tableName; } public String getColumnName() {

return columnName; } public void setColumnName(String columnName) {

this .columnName = columnName; } public String getNewValue() {

return newValue; } public void setNewValue(String newValue) {

this .newValue = newValue; }


      public SqlStatement[] generateStatements(Database database) 

throws UnsupportedChangeException { return new SqlStatement[] { new RawSqlStatement("update " + tableName + " set " + columnName + " = " + newValue) }; }

The classsname you listed in the changeset (Nathan