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, truncateTable
private static final int MAX_VARCHAR_LENGTH
public void adjustNextSequenceValue(StatementsWriter writer, String sequenceName, long currentSequenceValue, long nextSequenceValue, int incrementSize) throws IOException
GeneratorDialect
adjustNextSequenceValue
in class GeneratorDialect
writer
- 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)
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 buildNextSequenceValue(String sequence, int incrementSize)
GeneratorDialect
GeneratorDialect.isNextSequenceValueInInsertSupported()
this will return an expression or a statement.buildNextSequenceValue
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 usedpublic String convertTemporalValue(Date value, javax.persistence.TemporalType type)
GeneratorDialect
convertTemporalValue
in class GeneratorDialect
value
- the timestamp valuetype
- the typeprotected 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 String getOptionalTable()
GeneratorDialect
getOptionalTable
in class GeneratorDialect
public boolean isEmptyStringEqualToNull()
GeneratorDialect
null
in this database.
Important for NotNull
constraints, where an empty string would result in the same constraint violation.isEmptyStringEqualToNull
in class GeneratorDialect
true
if this database assumes that an empty string is the same as null
public boolean isFastInTransaction()
GeneratorDialect
isFastInTransaction
in class GeneratorDialect
true
if an transaction is faster than auto commitpublic boolean isIdentitySupported()
GeneratorDialect
isIdentitySupported
in class GeneratorDialect
true
if the database supports identitiespublic boolean isSequenceInWhereSupported()
GeneratorDialect
WHERE
expressions are supported.isSequenceInWhereSupported
in class GeneratorDialect
true
if this database supports sequences in WHERE
expressionspublic String quoteString(String value)
GeneratorDialect
quoteString
in class GeneratorDialect
value
- the value to quoteCopyright © 2022 fastnate.org. All rights reserved.