| 1 |  |  package liquibase.sqlgenerator.core; | 
  | 2 |  |   | 
  | 3 |  |  import liquibase.database.Database; | 
  | 4 |  |  import liquibase.database.core.DB2Database; | 
  | 5 |  |  import liquibase.exception.DatabaseException; | 
  | 6 |  |  import liquibase.exception.UnexpectedLiquibaseException; | 
  | 7 |  |  import liquibase.exception.ValidationErrors; | 
  | 8 |  |  import liquibase.sql.Sql; | 
  | 9 |  |  import liquibase.sql.UnparsedSql; | 
  | 10 |  |  import liquibase.sqlgenerator.SqlGenerator; | 
  | 11 |  |  import liquibase.sqlgenerator.SqlGeneratorChain; | 
  | 12 |  |  import liquibase.statement.core.SelectSequencesStatement; | 
  | 13 |  |   | 
  | 14 | 10 |  public class SelectSequencesGeneratorDB2 extends AbstractSqlGenerator<SelectSequencesStatement> { | 
  | 15 |  |      @Override | 
  | 16 |  |      public int getPriority() { | 
  | 17 | 1 |          return PRIORITY_DATABASE; | 
  | 18 |  |      } | 
  | 19 |  |   | 
  | 20 |  |      @Override | 
  | 21 |  |      public boolean supports(SelectSequencesStatement statement, Database database) { | 
  | 22 | 0 |          return database instanceof DB2Database; | 
  | 23 |  |      } | 
  | 24 |  |   | 
  | 25 |  |      public ValidationErrors validate(SelectSequencesStatement statement, Database database, | 
  | 26 |  |              SqlGeneratorChain sqlGeneratorChain) { | 
  | 27 | 0 |          return new ValidationErrors(); | 
  | 28 |  |      } | 
  | 29 |  |   | 
  | 30 |  |      public Sql[] generateSql(SelectSequencesStatement statement, Database database, SqlGeneratorChain sqlGeneratorChain) { | 
  | 31 |  |          try { | 
  | 32 | 0 |              return new Sql[] { new UnparsedSql( | 
  | 33 |  |                      "SELECT SEQNAME AS SEQUENCE_NAME FROM SYSCAT.SEQUENCES WHERE SEQTYPE='S' AND SEQSCHEMA = '" | 
  | 34 |  |                              + database.convertRequestedSchemaToSchema(statement.getSchemaName()) + "'") }; | 
  | 35 | 0 |          } catch (DatabaseException e) { | 
  | 36 | 0 |              throw new UnexpectedLiquibaseException(e); | 
  | 37 |  |          } | 
  | 38 |  |      } | 
  | 39 |  |  } |