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, quoteString
protected void addQuotedCharacter(StringBuilder result, char c)
GeneratorDialect
addQuotedCharacter
in class GeneratorDialect
result
- the current result bufferc
- the character to quotepublic void adjustNextIdentityValue(StatementsWriter writer, GeneratorTable table, GeneratorColumn columnName, long nextValue) throws IOException
GeneratorDialect
adjustNextIdentityValue
in class GeneratorDialect
writer
- 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)
GeneratorDialect
buildCurrentSequenceValue
in class GeneratorDialect
sequence
- 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)
GeneratorDialect
convertBooleanValue
in class GeneratorDialect
value
- the value to convertprotected String createAddDateExpression(String referenceDate, long value, String unit)
GeneratorDialect
createAddDateExpression
in class GeneratorDialect
referenceDate
- the expression for the reference datevalue
- the value to add to the dateunit
- the unit of the valuepublic String createBlobExpression(byte[] blob)
GeneratorDialect
createBlobExpression
in class GeneratorDialect
blob
- the bytes to convertpublic void truncateTable(StatementsWriter writer, GeneratorTable table) throws IOException
GeneratorDialect
truncateTable
in class GeneratorDialect
writer
- the target of the statementtable
- the table to truncateIOException
- if the writer throws oneCopyright © 2022 fastnate.org. All rights reserved.