public class PostgresDialect extends GeneratorDialect
NOW| Constructor and Description |
|---|
PostgresDialect() |
| Modifier and Type | Method and Description |
|---|---|
protected void |
addQuotedCharacter(StringBuilder result,
char c)
Adds a quoted character to the result string buffer.
|
void |
adjustNextIdentityValue(StatementsWriter writer,
GeneratorTable table,
GeneratorColumn columnName,
long nextValue)
Adjusts the next value of the given identity column to ensure that it is bigger than the last generated value.
|
String |
buildCurrentSequenceValue(String sequence,
int incrementSize,
boolean firstCall)
Builds the SQL expression that is used for referencing the current value of the given sequence.
|
String |
convertBooleanValue(boolean value)
Converts a boolean value to an SQL expression for the current database type.
|
protected String |
createAddDateExpression(String referenceDate,
long value,
String unit)
Creates an SQL expression to add a value to a date.
|
String |
createBlobExpression(byte[] blob)
Converts the given byte array to an SQL expression for the current database.
|
void |
truncateTable(StatementsWriter writer,
GeneratorTable table)
Adds a "truncate table" statement to the given writer.
|
adjustNextSequenceValue, buildNextSequenceValue, convertNumberValue, convertTemporalValue, convertTemporalValue, convertToDatabaseDate, createHexBlobExpression, getAutoGenerationType, getConcatOperator, getEmptyValuesExpression, getLetter, getOptionalTable, isEmptyStringEqualToNull, isEmulatingSequences, isFastInTransaction, isIdentitySupported, isNextSequenceValueInInsertSupported, isSelectFromSameTableInInsertSupported, isSequenceInWhereSupported, isSequenceSupported, isSettingIdentityAllowed, quoteStringprotected void addQuotedCharacter(StringBuilder result, char c)
GeneratorDialectaddQuotedCharacter in class GeneratorDialectresult - the current result bufferc - the character to quotepublic void adjustNextIdentityValue(StatementsWriter writer, GeneratorTable table, GeneratorColumn columnName, long nextValue) throws IOException
GeneratorDialectadjustNextIdentityValue in class GeneratorDialectwriter - the target of any generated statementtable - the table of the columncolumnName - the (auto increment) identity columnnextValue - the next value of the identity columnIOException - if the writer throws onepublic String buildCurrentSequenceValue(String sequence, int incrementSize, boolean firstCall)
GeneratorDialectbuildCurrentSequenceValue in class GeneratorDialectsequence - the fully qualified name of the sequenceincrementSize - the expected incrementSize, as given in the schema - used by some dialects to ensure that exactly that
inrement is usedfirstCall - indicates that the sequence was not updated before in this session - we may need to use a different
approach to get the current valuepublic String convertBooleanValue(boolean value)
GeneratorDialectconvertBooleanValue in class GeneratorDialectvalue - the value to convertprotected String createAddDateExpression(String referenceDate, long value, String unit)
GeneratorDialectcreateAddDateExpression in class GeneratorDialectreferenceDate - the expression for the reference datevalue - the value to add to the dateunit - the unit of the valuepublic String createBlobExpression(byte[] blob)
GeneratorDialectcreateBlobExpression in class GeneratorDialectblob - the bytes to convertpublic void truncateTable(StatementsWriter writer, GeneratorTable table) throws IOException
GeneratorDialecttruncateTable in class GeneratorDialectwriter - the target of the statementtable - the table to truncateIOException - if the writer throws oneCopyright © 2022 fastnate.org. All rights reserved.