Coverage Report - liquibase.sqlgenerator.core.SelectSequencesGeneratorHsql
 
Classes in this File Line Coverage Branch Coverage Complexity
SelectSequencesGeneratorHsql
28%
2/7
N/A
1.75
 
 1  
 package liquibase.sqlgenerator.core;
 2  
 
 3  
 import liquibase.database.Database;
 4  
 import liquibase.database.core.H2Database;
 5  
 import liquibase.database.core.HsqlDatabase;
 6  
 import liquibase.exception.DatabaseException;
 7  
 import liquibase.exception.UnexpectedLiquibaseException;
 8  
 import liquibase.exception.ValidationErrors;
 9  
 import liquibase.sql.Sql;
 10  
 import liquibase.sql.UnparsedSql;
 11  
 import liquibase.sqlgenerator.SqlGenerator;
 12  
 import liquibase.sqlgenerator.SqlGeneratorChain;
 13  
 import liquibase.statement.core.SelectSequencesStatement;
 14  
 
 15  10
 public class SelectSequencesGeneratorHsql extends AbstractSqlGenerator<SelectSequencesStatement> {
 16  
     @Override
 17  
     public int getPriority() {
 18  1
         return PRIORITY_DATABASE;
 19  
     }
 20  
 
 21  
     @Override
 22  
     public boolean supports(SelectSequencesStatement statement, Database database) {
 23  0
         return database instanceof HsqlDatabase;
 24  
     }
 25  
 
 26  
     public ValidationErrors validate(SelectSequencesStatement statement, Database database,
 27  
             SqlGeneratorChain sqlGeneratorChain) {
 28  0
         return new ValidationErrors();
 29  
     }
 30  
 
 31  
     public Sql[] generateSql(SelectSequencesStatement statement, Database database, SqlGeneratorChain sqlGeneratorChain) {
 32  
         try {
 33  0
             return new Sql[] { new UnparsedSql(
 34  
                     "SELECT SEQUENCE_NAME FROM INFORMATION_SCHEMA.SYSTEM_SEQUENCES WHERE SEQUENCE_SCHEMA = '"
 35  
                             + database.convertRequestedSchemaToSchema(statement.getSchemaName()) + "'") };
 36  0
         } catch (DatabaseException e) {
 37  0
             throw new UnexpectedLiquibaseException(e);
 38  
         }
 39  
     }
 40  
 }