A new topic, 'is it possible to generateChangeLog diffTypes=data 
programatically?', has been made on a board you are watching.

You can see it at
http://liquibase.org/forum/index.php?topic=825.new#new

The text of the topic is shown below:

hi all,

is it possible to "generateChangeLog diffTypes=data" programatically? Because 
the Liquibase facade does not provide any method for
that task.

im using liquibase-2.0-rc7.jar and derby 10.3.1.4

actually, im doing the following
Code:
public class DatabaseExporterImpl implements DatabaseExporter {

    private static final String DIFF_TYPES = "data";
    private ExceptionFactory exceptionFactory;
    private String username;
    private String password;
    private String driverClassName;
    private String author;
    private String connectionURL;

    @Override
    public void exportTo(String filename) {
        try {

            ClassLoader classLoader = this.getClass().getClassLoader();
            Database database = CommandLineUtils.createDatabaseObject(
                    classLoader, connectionURL, username, password,
                    driverClassName, null, null);
            CommandLineUtils.doGenerateChangeLog(filename, database, null,
                    DIFF_TYPES, author, null, null);

        } catch (LiquibaseException e) {
            throw cannotExportDatabaseTo(filename, e);
        } catch (IOException e) {
            throw cannotExportDatabaseTo(filename, e);
        } catch (ParserConfigurationException e) {
            throw cannotExportDatabaseTo(filename, e);
        }
    }

    private DataExporterException cannotExportDatabaseTo(String filename,
            Throwable cause) {
        Object[] args = new Object[] { filename };
        MessageCode code = MessageCode.CANNOT_EXPORT_DATABASE;
        return exceptionFactory.newInstanceFor(code, args, cause);
    }

    public void setConnectionURL(String connectionURL) {
        this.connectionURL = connectionURL;
    }

    public void setUsername(String username) {
        this.username = username;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public void setDriverClassName(String driverClassName) {
        this.driverClassName = driverClassName;
    }

    public void setAuthor(String author) {
        this.author = author;
    }

    public void setExceptionFactory(ExceptionFactory factory) {
        this.exceptionFactory = factory;
    }

}


but IMO it's just a hack 
because after that i'm having problems with the changelog file, because it 
remains open (basically a stream remains open somewhere).
and i cannot compress the file.
so, is there a correct way to "generateChangeLog diffTypes=data" 
programatically?

thanks in advance.

Unsubscribe to new topics from this board by clicking here: 
http://liquibase.org/forum/index.php?action=notifyboard;board=1.0

Regards,
The Liquibase Community Forum Team.
------------------------------------------------------------------------------
_______________________________________________
Liquibase-user mailing list
Liquibase-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/liquibase-user

Reply via email to