public class MySqlDialect extends GeneratorDialect
NOW
Constructor and Description |
---|
MySqlDialect() |
Modifier and Type | Method and Description |
---|---|
List<? extends EntityStatement> |
adjustNextSequenceValue(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)
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 |
createBlobExpression(byte[] blob)
Create MySQL specific binary expression.
|
String |
createSql(EntityStatement stmt)
Replace any subselect in an insert statement, if the same table is selected.
|
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 |
isNextSequenceValueInInsertSupported()
Indicates that a sequence may be updated in the insert statement.
|
boolean |
isSequenceSupported()
Indicates that sequences are supported by the database.
|
String |
quoteString(String value)
Create MySQL specific quoting of the string.
|
addQuotedCharacter, adjustNextIdentityValue, convertBooleanValue, convertTemporalValue, createHexBlobExpression, getAutoGenerationType, isEmptyStringEqualToNull, isIdentitySupported, isSequenceInWhereSupported
public List<? extends EntityStatement> adjustNextSequenceValue(String sequenceName, long currentSequenceValue, long nextSequenceValue, int incrementSize)
GeneratorDialect
adjustNextSequenceValue
in class GeneratorDialect
sequenceName
- the name of the sequencecurrentSequenceValue
- the current value of the sequencenextSequenceValue
- the next value of the sequenceincrementSize
- the increment size of the sequencepublic String buildCurrentSequenceValue(String sequence, int incrementSize)
GeneratorDialect
buildCurrentSequenceValue
in class GeneratorDialect
sequence
- the 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 buildNextSequenceValue(String sequence, int incrementSize)
GeneratorDialect
GeneratorDialect.isNextSequenceValueInInsertSupported()
this will return an expression or a statement.buildNextSequenceValue
in class GeneratorDialect
sequence
- the 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 createBlobExpression(byte[] blob)
createBlobExpression
in class GeneratorDialect
blob
- the bytes to convertpublic String createSql(EntityStatement stmt)
createSql
in class GeneratorDialect
stmt
- contains the table and all column valuespublic String getOptionalTable()
GeneratorDialect
getOptionalTable
in class GeneratorDialect
public boolean isNextSequenceValueInInsertSupported()
GeneratorDialect
isNextSequenceValueInInsertSupported
in class GeneratorDialect
true
to indicate that GeneratorDialect.buildNextSequenceValue(String,int)
will return an expression that
may be used in an INSERT statement, false
to indicate that
GeneratorDialect.buildNextSequenceValue(String,int)
returns a full statementpublic boolean isSequenceSupported()
GeneratorDialect
isSequenceSupported
in class GeneratorDialect
true
if the database supports sequencespublic String quoteString(String value)
quoteString
in class GeneratorDialect
value
- the value to quoteCopyright © 2016 fastnate.org. All rights reserved.