Interface SqlScript
- All Superinterfaces:
Comparable<SqlScript>
- All Known Implementing Classes:
ParserSqlScript
SQL script containing a series of statements terminated by a delimiter (eg: ;). Single-line (--) and multi-line (/* *
/) comments are stripped and ignored.
-
Method Summary
Modifier and TypeMethodDescriptionbooleanWhether the execution should take place inside a transaction.intbooleanWhether the script should execute or not.voidvalidate()Validates this SQL script.Methods inherited from interface java.lang.Comparable
compareTo
-
Method Details
-
getSqlStatements
SqlStatementIterator getSqlStatements()- Returns:
- The sql statements contained in this script.
-
getSqlStatementCount
int getSqlStatementCount()- Returns:
- The number of sql statements contained in this script.
-
getResource
Resource getResource()- Returns:
- The resource containing the statements.
-
executeInTransaction
boolean executeInTransaction()Whether the execution should take place inside a transaction. This is useful for databases like PostgreSQL where certain statement can only execute outside a transaction.- Returns:
trueif a transaction should be used (highly recommended), orfalseif not.
-
shouldExecute
boolean shouldExecute()Whether the script should execute or not.- Returns:
trueif the script should execute, orfalseif not.
-
validate
void validate()Validates this SQL script.
-