public class OracleDialect extends GeneratorDialect
| Modifier and Type | Field and Description |
|---|---|
private static int |
MAX_VARCHAR_LENGTH |
NOW| Constructor and Description |
|---|
OracleDialect() |
| Modifier and Type | Method and Description |
|---|---|
void |
adjustNextSequenceValue(StatementsWriter writer,
String sequenceName,
long currentSequenceValue,
long nextSequenceValue,
int incrementSize)
Adjusts the given sequence to ensure that the next value is exactly the given 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 |
buildNextSequenceValue(String sequence,
int incrementSize)
Builds the SQL expression resp. statement that is used for creating the next value of the given sequence.
|
String |
convertTemporalValue(Date value,
javax.persistence.TemporalType type)
Converts a date to an appropriate SQL expression.
|
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.
|
String |
getOptionalTable()
Returns the string to use when no table is required, e.g. for "SELECT 1, 2 FROM DUAL" this would return "FROM
DUAL".
|
boolean |
isEmptyStringEqualToNull()
Indicates that the empty string is equal to
null in this database. |
boolean |
isFastInTransaction()
Indicates that the database usually faster when all statements are executed within an transaction.
|
boolean |
isIdentitySupported()
Indicates that identity columns are supported by the database.
|
boolean |
isSequenceInWhereSupported()
Indicates that references to sequences in
WHERE expressions are supported. |
String |
quoteString(String value)
Quotes the given string.
|
addQuotedCharacter, adjustNextIdentityValue, convertBooleanValue, convertNumberValue, convertTemporalValue, convertToDatabaseDate, createHexBlobExpression, getAutoGenerationType, getConcatOperator, getEmptyValuesExpression, getLetter, isEmulatingSequences, isNextSequenceValueInInsertSupported, isSelectFromSameTableInInsertSupported, isSequenceSupported, isSettingIdentityAllowed, truncateTableprivate static final int MAX_VARCHAR_LENGTH
public void adjustNextSequenceValue(StatementsWriter writer, String sequenceName, long currentSequenceValue, long nextSequenceValue, int incrementSize) throws IOException
GeneratorDialectadjustNextSequenceValue in class GeneratorDialectwriter - the target of the generated statementssequenceName - the fully qualified name of the sequencecurrentSequenceValue - the current value of the sequencenextSequenceValue - the next value of the sequenceincrementSize - the increment size of the sequenceIOException - 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 buildNextSequenceValue(String sequence, int incrementSize)
GeneratorDialectGeneratorDialect.isNextSequenceValueInInsertSupported() this will return an expression or a statement.buildNextSequenceValue 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 usedpublic String convertTemporalValue(Date value, javax.persistence.TemporalType type)
GeneratorDialectconvertTemporalValue in class GeneratorDialectvalue - the timestamp valuetype - the typeprotected 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 String getOptionalTable()
GeneratorDialectgetOptionalTable in class GeneratorDialectpublic boolean isEmptyStringEqualToNull()
GeneratorDialectnull in this database.
Important for NotNull constraints, where an empty string would result in the same constraint violation.isEmptyStringEqualToNull in class GeneratorDialecttrue if this database assumes that an empty string is the same as nullpublic boolean isFastInTransaction()
GeneratorDialectisFastInTransaction in class GeneratorDialecttrue if an transaction is faster than auto commitpublic boolean isIdentitySupported()
GeneratorDialectisIdentitySupported in class GeneratorDialecttrue if the database supports identitiespublic boolean isSequenceInWhereSupported()
GeneratorDialectWHERE expressions are supported.isSequenceInWhereSupported in class GeneratorDialecttrue if this database supports sequences in WHERE expressionspublic String quoteString(String value)
GeneratorDialectquoteString in class GeneratorDialectvalue - the value to quoteCopyright © 2022 fastnate.org. All rights reserved.