Package liquibase.sqlgenerator.core
Class InsertOrUpdateGeneratorMSSQL
java.lang.Object
liquibase.sqlgenerator.core.AbstractSqlGenerator<InsertOrUpdateStatement>
liquibase.sqlgenerator.core.InsertOrUpdateGenerator
liquibase.sqlgenerator.core.InsertOrUpdateGeneratorMSSQL
- All Implemented Interfaces:
PrioritizedService
,SqlGenerator<InsertOrUpdateStatement>
-
Field Summary
Fields inherited from interface liquibase.servicelocator.PrioritizedService
COMPARATOR
Fields inherited from interface liquibase.sqlgenerator.SqlGenerator
EMPTY_SQL, PRIORITY_DATABASE, PRIORITY_DEFAULT
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionSql[]
generateSql
(InsertOrUpdateStatement insertOrUpdateStatement, Database database, SqlGeneratorChain sqlGeneratorChain) Generate the actual Sql for the given statement and database.protected String
protected String
getInsertStatement
(InsertOrUpdateStatement insertOrUpdateStatement, Database database, SqlGeneratorChain sqlGeneratorChain) protected String
getRecordCheck
(InsertOrUpdateStatement insertOrUpdateStatement, Database database, String whereClause) protected String
getUpdateStatement
(InsertOrUpdateStatement insertOrUpdateStatement, Database database, String whereClause, SqlGeneratorChain sqlGeneratorChain) Generates an SQL UPDATE statement for the specified insert or update statement, database, and SQL generator chain.boolean
supports
(InsertOrUpdateStatement statement, Database database) Does this generator support the given statement/database combination?Methods inherited from class liquibase.sqlgenerator.core.InsertOrUpdateGenerator
getAffectedTable, getPostUpdateStatements, getPriority, getWhereClause, validate
Methods inherited from class liquibase.sqlgenerator.core.AbstractSqlGenerator
generateRollbackStatementsIsVolatile, generateStatementsIsVolatile, looksLikeFunctionCall, warn
-
Constructor Details
-
InsertOrUpdateGeneratorMSSQL
public InsertOrUpdateGeneratorMSSQL()
-
-
Method Details
-
supports
Description copied from interface:SqlGenerator
Does this generator support the given statement/database combination? Do not validate the statement with this method, only return if it can support it.- Specified by:
supports
in interfaceSqlGenerator<InsertOrUpdateStatement>
- Overrides:
supports
in classAbstractSqlGenerator<InsertOrUpdateStatement>
-
getRecordCheck
protected String getRecordCheck(InsertOrUpdateStatement insertOrUpdateStatement, Database database, String whereClause) - Specified by:
getRecordCheck
in classInsertOrUpdateGenerator
-
getInsertStatement
protected String getInsertStatement(InsertOrUpdateStatement insertOrUpdateStatement, Database database, SqlGeneratorChain sqlGeneratorChain) - Overrides:
getInsertStatement
in classInsertOrUpdateGenerator
-
getElse
- Specified by:
getElse
in classInsertOrUpdateGenerator
-
getUpdateStatement
protected String getUpdateStatement(InsertOrUpdateStatement insertOrUpdateStatement, Database database, String whereClause, SqlGeneratorChain sqlGeneratorChain) throws LiquibaseException Description copied from class:InsertOrUpdateGenerator
Generates an SQL UPDATE statement for the specified insert or update statement, database, and SQL generator chain.- Overrides:
getUpdateStatement
in classInsertOrUpdateGenerator
- Parameters:
insertOrUpdateStatement
- the insert or update statement to generate the update statement fromdatabase
- the database to generate the update statement forwhereClause
- the WHERE clause to use in the update statementsqlGeneratorChain
- the SQL generator chain to use in the update statement- Returns:
- the generated update statement, or
null
if there is nothing to update - Throws:
LiquibaseException
- if there is an error generating the update statement
-
generateSql
public Sql[] generateSql(InsertOrUpdateStatement insertOrUpdateStatement, Database database, SqlGeneratorChain sqlGeneratorChain) Description copied from interface:SqlGenerator
Generate the actual Sql for the given statement and database.- Specified by:
generateSql
in interfaceSqlGenerator<InsertOrUpdateStatement>
- Overrides:
generateSql
in classInsertOrUpdateGenerator
-