Package liquibase.statement.core

Examples of liquibase.statement.core.RawSqlStatement


        return enabled;
    }

    @Override
    public void enableForeignKeyChecks() throws DatabaseException {
        ExecutorService.getInstance().getExecutor(this).execute(new RawSqlStatement("SET FOREIGN_KEY_CHECKS=1"));
    }
View Full Code Here


    protected String getConnectionCatalogName() throws DatabaseException {
        if (getConnection() == null || getConnection() instanceof OfflineConnection) {
            return null;
        }
        try {
            return ExecutorService.getInstance().getExecutor(this).queryForObject(new RawSqlStatement("select current schema from sysibm.sysdummy1"), String.class);
        } catch (Exception e) {
            LogFactory.getLogger().info("Error getting default schema", e);
        }
        return null;
    }
View Full Code Here

    public Set<String> getUserDefinedTypes() {
        if (userDefinedTypes == null) {
            userDefinedTypes = new HashSet<String>();
            if (getConnection() != null && !(getConnection() instanceof OfflineConnection)) {
                try {
                    userDefinedTypes.addAll(ExecutorService.getInstance().getExecutor(this).queryForList(new RawSqlStatement("SELECT TYPE_NAME FROM USER_TYPES"), String.class));
                } catch (DatabaseException e) {
                    //ignore error
                }
            }
        }
View Full Code Here

    public void dateDefaultValue() throws Exception {
        if (getDatabase() == null) {
            return;
        }

        ExecutorService.getInstance().getExecutor(getDatabase()).execute(new RawSqlStatement("CREATE TABLE ad (\n" +
                "ad_id int(10) unsigned NOT NULL AUTO_INCREMENT,\n" +
                "advertiser_id int(10) unsigned NOT NULL,\n" +
                "ad_type_id int(10) unsigned NOT NULL,\n" +
                "name varchar(155) NOT NULL DEFAULT '',\n" +
                "label varchar(155)NOT NULL DEFAULT '',\n" +
View Full Code Here

    }

    @Override
    public SqlStatement[] generateStatements(Database database) {
        return new SqlStatement[]{
                new RawSqlStatement("update "+database.escapeObjectName(tableName, Table.class)
                        +" set "+database.escapeObjectName(columnName, Column.class)+" = "+newValue)
        };
    }
View Full Code Here

    }

    @Override
    public SqlStatement[] generateRollbackStatements(Database database) throws RollbackImpossibleException {
        return new SqlStatement[]{
                new RawSqlStatement("update "+database.correctObjectName(tableName, Table.class)
                        +" set "+database.escapeObjectName(columnName, Column.class)+" = null")
        };
    }
View Full Code Here

    }

    @Override
    public void checkDiffResult(DiffResult diffResult, TagDatabaseChange change) throws Exception {
        Database database = diffResult.getComparisonSnapshot().getDatabase();
        int rows = ExecutorService.getInstance().getExecutor(database).queryForInt(new RawSqlStatement("select count(*) from " + database.getDatabaseChangeLogTableName() + " where tag='" + change.getTag() + "'"));
        assertTrue(rows > 0);

    }
View Full Code Here

    }

    @Override
    public void checkDiffResult(DiffResult diffResult, InsertDataChange change) throws Exception {
        Database database = diffResult.getComparisonSnapshot().getDatabase();
        int rows = ExecutorService.getInstance().getExecutor(database).queryForInt(new RawSqlStatement("select count(*) from " + database.escapeTableName(change.getCatalogName(), change.getSchemaName(), change.getTableName())));
        assertTrue(rows > 0);
    }
View Full Code Here

TOP

Related Classes of liquibase.statement.core.RawSqlStatement

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.