T
- an implementation of the SqlStatement
specifying which
logical SQL statement an instance of this template class is able to generate SQL for.public abstract class AbstractSqlGenerator<T extends SqlStatement> extends Object implements SqlGenerator<T>
SqlStatement
.EMPTY_SQL, PRIORITY_DATABASE, PRIORITY_DEFAULT
COMPARATOR
Constructor and Description |
---|
AbstractSqlGenerator() |
Modifier and Type | Method and Description |
---|---|
boolean |
generateRollbackStatementsIsVolatile(Database database) |
boolean |
generateStatementsIsVolatile(Database database)
Does this change require access to the database metadata? If true, the change cannot be used in an
updateSql-style command.
|
int |
getPriority()
Of all the SqlGenerators that "support" a given SqlStatement/Database, SqlGeneratorFactory will return the one
with the highest priority.
|
boolean |
looksLikeFunctionCall(String value,
Database database)
Tries to find out if a given value (part a database-specific SQL statement) is just a simple literal
(e.g.
|
boolean |
supports(T statement,
Database database)
Does this generator support the given statement/database combination? Do not validate the statement with this
method, only return if it can support it.
|
Warnings |
warn(T statementType,
Database database,
SqlGeneratorChain<T> sqlGeneratorChain) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
generateSql, validate
public int getPriority()
SqlGenerator
getPriority
in interface PrioritizedService
getPriority
in interface SqlGenerator<T extends SqlStatement>
public boolean generateStatementsIsVolatile(Database database)
SqlGenerator
generateStatementsIsVolatile
in interface SqlGenerator<T extends SqlStatement>
public boolean generateRollbackStatementsIsVolatile(Database database)
generateRollbackStatementsIsVolatile
in interface SqlGenerator<T extends SqlStatement>
public boolean supports(T statement, Database database)
SqlGenerator
supports
in interface SqlGenerator<T extends SqlStatement>
public Warnings warn(T statementType, Database database, SqlGeneratorChain<T> sqlGeneratorChain)
warn
in interface SqlGenerator<T extends SqlStatement>
public boolean looksLikeFunctionCall(String value, Database database)
INSERT INTO customers(last_name) VALUES('Dr. Jones')
but if the value is a function call, we may not quote it, e.g. for "TO_DATE('28.12.2017', 'dd.mm.yyyy')", we
need to generate (note the absence of the apostrophes!):
INSERT INTO bookings(booking_date) VALUES (TO_DATE('28.12.2017', 'dd.mm.yyyy'))
value
- The string to testdatabase
- the database object to test againstCopyright © 2023 Liquibase.org. All rights reserved.