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, isSequenceInWhereSupportedpublic List<? extends EntityStatement> adjustNextSequenceValue(String sequenceName, long currentSequenceValue, long nextSequenceValue, int incrementSize)
GeneratorDialectadjustNextSequenceValue in class GeneratorDialectsequenceName - 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)
GeneratorDialectbuildCurrentSequenceValue in class GeneratorDialectsequence - 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)
GeneratorDialectGeneratorDialect.isNextSequenceValueInInsertSupported() this will return an expression or a statement.buildNextSequenceValue in class GeneratorDialectsequence - 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 GeneratorDialectblob - the bytes to convertpublic String createSql(EntityStatement stmt)
createSql in class GeneratorDialectstmt - contains the table and all column valuespublic String getOptionalTable()
GeneratorDialectgetOptionalTable in class GeneratorDialectpublic boolean isNextSequenceValueInInsertSupported()
GeneratorDialectisNextSequenceValueInInsertSupported in class GeneratorDialecttrue 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()
GeneratorDialectisSequenceSupported in class GeneratorDialecttrue if the database supports sequencespublic String quoteString(String value)
quoteString in class GeneratorDialectvalue - the value to quoteCopyright © 2016 fastnate.org. All rights reserved.