@Test public void testGenerateSqlForNamedSchema() { GetViewDefinitionGeneratorSybase generator = new GetViewDefinitionGeneratorSybase(); GetViewDefinitionStatement statement = new GetViewDefinitionStatement("owner", "view_name"); Sql[] sql = generator.generateSql(statement, new SybaseDatabase(), null); assertEquals(1, sql.length); assertEquals("select text from syscomments where id = object_id('owner.view_name') order by colid", sql[0].toSql()); }
@Override public Sql[] generateSql(GetViewDefinitionStatement statement, Database database, SqlGeneratorChain sqlGeneratorChain) { try { String sql = "select text from syscomments where id = object_id('" + database.convertRequestedSchemaToSchema(statement.getSchemaName()) + "." + statement.getViewName() + "') order by colid"; return new Sql[]{ new UnparsedSql(sql) }; } catch (DatabaseException e) { throw new UnexpectedLiquibaseException(e); } }
GetViewDefinitionGeneratorSybase extends GetViewDefinitionGenerator { @Override public Sql[] generateSql(GetViewDefinitionStatement statement, Database database, SqlGeneratorChain sqlGeneratorChain) { try { String sql = "select text from syscomments where id = object_id('" + database.convertRequestedSchemaToSchema(statement.getSchemaName()) + "." + statement.getViewName() + "') order by colid"; return new Sql[]{ new UnparsedSql(sql) }; } catch (DatabaseException e) { throw new UnexpectedLiquibaseException(e); } } }
GetViewDefinitionGeneratorSybase extends GetViewDefinitionGenerator { @Override public Sql[] generateSql(GetViewDefinitionStatement statement, Database database, SqlGeneratorChain sqlGeneratorChain) { try { String sql = "select text from syscomments where id = object_id('" + database.convertRequestedSchemaToSchema(statement.getSchemaName()) + "." + statement.getViewName() + "') order by colid"; return new Sql[]{ new UnparsedSql(sql) }; } catch (DatabaseException e) { throw new UnexpectedLiquibaseException(e); } }  }
GetViewDefinitionGeneratorSybase extends GetViewDefinitionGenerator { @Override public Sql[] generateSql(GetViewDefinitionStatement statement, Database database, SqlGeneratorChain sqlGeneratorChain) { try { String sql = "select text from syscomments where id = object_id('" + database.convertRequestedSchemaToSchema(statement.getSchemaName()) + "." + statement.getViewName() + "') order by colid"; return new Sql[]{ new UnparsedSql(sql) }; } catch (DatabaseException e) { throw new UnexpectedLiquibaseException(e); } }  @Override int getPriority(); @Override boolean supports(GetViewDefinitionStatement statement, Database database); @Override Sql[] generateSql(GetViewDefinitionStatement statement, Database database, SqlGeneratorChain sqlGeneratorChain); }
GetViewDefinitionGeneratorSybase extends GetViewDefinitionGenerator { @Override public Sql[] generateSql(GetViewDefinitionStatement statement, Database database, SqlGeneratorChain sqlGeneratorChain) { try { String sql = "select text from syscomments where id = object_id('" + database.convertRequestedSchemaToSchema(statement.getSchemaName()) + "." + statement.getViewName() + "') order by colid"; return new Sql[]{ new UnparsedSql(sql) }; } catch (DatabaseException e) { throw new UnexpectedLiquibaseException(e); } }  @Override int getPriority(); @Override boolean supports(GetViewDefinitionStatement statement, Database database); @Override Sql[] generateSql(GetViewDefinitionStatement statement, Database database, SqlGeneratorChain sqlGeneratorChain);  }