Interface SqlScript
-
- All Superinterfaces:
Comparable<SqlScript>
- All Known Implementing Classes:
ParserSqlScript
public interface SqlScript extends Comparable<SqlScript>
SQL script containing a series of statements terminated by a delimiter (eg: ;). Single-line (--) and multi-line (/* * /) comments are stripped and ignored.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description booleanexecuteInTransaction()Whether the execution should take place inside a transaction.ResourcegetResource()intgetSqlStatementCount()SqlStatementIteratorgetSqlStatements()booleanshouldExecute()Whether the script should execute or not.voidvalidate()Validates this SQL script.-
Methods inherited from interface java.lang.Comparable
compareTo
-
-
-
-
Method Detail
-
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.
-
-