Coverage Report - liquibase.sqlgenerator.core.SelectSequencesGeneratorMaxDB
 
Classes in this File Line Coverage Branch Coverage Complexity
SelectSequencesGeneratorMaxDB
28%
2/7
N/A
1.75
 
 1  
 package liquibase.sqlgenerator.core;
 2  
 
 3  
 import liquibase.database.Database;
 4  
 import liquibase.database.core.MaxDBDatabase;
 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 SelectSequencesGeneratorMaxDB 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 MaxDBDatabase;
 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("SELECT SEQUENCE_NAME FROM DOMAIN.SEQUENCES WHERE OWNER = '"
 33  
                     + database.convertRequestedSchemaToSchema(statement.getSchemaName()) + "'") };
 34  0
         } catch (DatabaseException e) {
 35  0
             throw new UnexpectedLiquibaseException(e);
 36  
         }
 37  
     }
 38  
 }