Package liquibase.statement.core

Examples of liquibase.statement.core.SelectFromDatabaseChangeLogLockStatement


    try {
      database.rollback();
      database.checkDatabaseChangeLogLockTable();
      Object lockObject = (Object) ExecutorService.getInstance().getExecutor(database)
          .queryForObject(new SelectFromDatabaseChangeLogLockStatement("LOCKED"), Object.class);
      if (checkReturnValue(lockObject)) {
        // To here
        return false;
      } else {
        executor.comment("Lock Database");
View Full Code Here


      if (!database.hasDatabaseChangeLogLockTable()) {
        return new DatabaseChangeLogLock[0];
      }

      List<DatabaseChangeLogLock> allLocks = new ArrayList<DatabaseChangeLogLock>();
      SqlStatement sqlStatement = new SelectFromDatabaseChangeLogLockStatement("ID", "LOCKED", "LOCKGRANTED",
          "LOCKEDBY");
      List<Map> rows = ExecutorService.getInstance().getExecutor(database).queryForList(sqlStatement);
      for (Map columnMap : rows) {
        Object lockedValue = columnMap.get("LOCKED");
        Boolean locked;
View Full Code Here

        super( new SelectFromDatabaseChangeLogLockGenerator());
    }

    @Override
    protected SelectFromDatabaseChangeLogLockStatement createSampleSqlStatement() {
        return new SelectFromDatabaseChangeLogLockStatement("LOCKED");
    }
View Full Code Here

        return Arrays.asList(new CreateDatabaseChangeLogLockTableStatement());
    }

    @Test
    public void generateSql() throws Exception {
        this.statementUnderTest = new SelectFromDatabaseChangeLogLockStatement("LOCKED");
        assertCorrect("select [locked] from [databasechangeloglock] where [id]=1", MSSQLDatabase.class, SybaseDatabase.class);
        assertCorrect("select [locked] from [databasechangeloglock] where [id]=1", SybaseASADatabase.class);
        assertCorrect("select [locked] from [databasechangeloglock] where [id]=1 for update", OracleDatabase.class);
        assertCorrectOnRest("select [locked] from [databasechangeloglock] where [id]=1");
    }
View Full Code Here

        assertCorrectOnRest("select [locked] from [databasechangeloglock] where [id]=1");
    }

    @Test
    public void generateSql_count() throws Exception {
        this.statementUnderTest = new SelectFromDatabaseChangeLogLockStatement(new ColumnConfig().setName("COUNT(*)", true));
        assertCorrect("select count(*) from [databasechangeloglock] where [id]=1", MSSQLDatabase.class, SybaseDatabase.class);
        assertCorrect("select count(*) from [databasechangeloglock] where [id]=1", MSSQLDatabase.class, SybaseASADatabase.class);
        assertCorrect("select count(*) from [databasechangeloglock] where [id]=1 for update", OracleDatabase.class);
        assertCorrectOnRest("select count(*) from [databasechangeloglock] where [id]=1");
    }
View Full Code Here

        assertCorrectOnRest("select count(*) from [databasechangeloglock] where [id]=1");
    }

    @Test
    public void generateSql_multicolumn() throws Exception {
        this.statementUnderTest = new SelectFromDatabaseChangeLogLockStatement("LOCKED", "LOCKEDBY");
        assertCorrect("select [locked],[lockedby] from [databasechangeloglock] where [id]=1", MSSQLDatabase.class, SybaseDatabase.class);
        assertCorrect("select [locked],[lockedby] from [databasechangeloglock] where [id]=1", MSSQLDatabase.class, SybaseASADatabase.class);
        assertCorrect("select [locked],[lockedby] from [databasechangeloglock] where [id]=1 for update", OracleDatabase.class);
        assertCorrectOnRest("select [locked],[lockedby] from [databasechangeloglock] where [id]=1");
    }
View Full Code Here

TOP

Related Classes of liquibase.statement.core.SelectFromDatabaseChangeLogLockStatement

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.