public class MariaDbDialect extends MariaDbLenientDialect
Dialect for an MariaDb/MySql backend.Dialect.WeightAggregator| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
DIALECT_ID
The id of this dialect variant as a string.
|
private static CentralLogger |
LOG
Logger
|
fwd2sql, highDate, lowDate, MAX_VARCHAR_SIZE, MIN_TEXT_SIZE, UDF_ERROR_MESSAGECASE_TYPE_TOK, DEFAULT_MAX_WIDTH, SCALE_TOK| Constructor and Description |
|---|
MariaDbDialect() |
| Modifier and Type | Method and Description |
|---|---|
java.lang.String |
getComputedColumnString(java.lang.String name,
java.lang.String type,
int scale,
boolean cs)
Writes the declaration of a computed column to a
StringBuilder based on its name, type, scale,
and case-sensitiveness. |
protected CentralLogger |
getLog()
Get the logger specific to this MariaDb dialect variant.
|
static java.util.List<java.lang.String> |
getReservedKeywords()
Get a collection of reserved keywords specific to this dialect.
|
java.lang.String |
id()
Get dialect id.
|
boolean |
injectComputedColumns()
MariaDb requires injecting computed columns for indexed fields due to lack of "nulls last" feature.
|
int |
orderByNulls(java.lang.StringBuilder sb,
java.lang.String expression,
java.lang.String field,
boolean asc,
boolean forceAsc)
Determine if the sort component or index needs to be augmented with a NULLS FIRST/LAST option and
add the required expression(s) as needed by this dialect.
|
activateErrorHandler, addRtrimmedExpression, blobCreator, buildRemoteURL, checkErrorFn, checkIndexConstraints, clobCreator, connectionCustomizer, createSequenceHandler, errorEntry, explicitSetCollation, extractColumnName, formatDate, generateWordTablesDDLImpl, getAddForeignKeyConstraintString, getAnalyzeString, getCatalogPattern, getCodepage, getCollation, getComputedColumnFormula, getComputedColumnPrefix, getCreateSequenceString, getCreateSequenceString, getCreateSequenceString, getCreateTemporaryTablePostfix, getCreateTemporaryTableString, getDelimiter, getDriverClassName, getDropIndexString, getDropIndexString, getDropSequenceString, getDropTableString, getJdbcDatabaseType, getProcessedCharacterColumnName, getSchemaPattern, getScriptRunner, getSequenceCurrValString, getSequenceNextValString, getSequencePrefetchString, getSequenceSetValString, getSequenceSetValString, getSequenceSetValString, getSequenceSQL, getSpecificTypeAsString, getSqlMappedType, getSyntheticIndexSize, getUdfErrorMessagePattern, hasFullSequenceSupport, initErrorFn, inlineLimit, isAutoCi, isAutoRtrim, isCaseInsensitiveColumn, isComputedColumn, isConnectionError, isMetadataSortAsc, isMetadataSortDesc, isNativeUDFsSupported, isQueryRangeParameterInlined, isUdfOriginatedError, isUdfOriginatedWarning, isUniqueConstraintViolation, needsComputedColumns, prepareMetadataParameter, preparePermanentDatabase, processMetadataResult, requiresExplicitCastInsideTernary, resetErrorHandler, scriptSplitter, supportsBooleanDatatype, supportsFunctionOverloading, translateToParmType, useUdf4Contains, useWordTablesallowBindParamsInRecursiveCTE, allowDBUniqueCheck, allowSelectWildcard, beforeDriverLoad, computeIndexKeySize, containsUdfName, createContext, dialects, getCreateIndexString, getCreateIndexString, getCreateIndexString, getCreateSequenceString, getCreateTableString, getDatabasePrepareStatements, getDecimals, getDialect, getDialect, getDialect, getHighDate, getIndexLengthLimit, getInvisibleSpecificator, getLimitString, getLowDate, getMaxEntriesInSelect, getMaxParameterCount, getSequenceCurrValString, getSqlIndexName, getSqlMappedType, isUdfContains, postTransaction, preferDisjunctiveForm, quote, resolveBooleanConstant, supportsLazyQueryResultsMode, supportsVariableLimit, udfSchema, useCTE4Contains, useMixedNode4Contains, useNullEquality, weightAggregatorpublic static final java.lang.String DIALECT_ID
private static final CentralLogger LOG
public java.lang.String id()
id in class MariaDbLenientDialectpublic static java.util.List<java.lang.String> getReservedKeywords()
The NameConverter uses thes list to create an exclusion
list of names so there will not be schema collisions with identifiers (tables, fields) from
the generated schema.
public boolean injectComputedColumns()
injectComputedColumns in class MariaDbLenientDialecttrue.public java.lang.String getComputedColumnString(java.lang.String name,
java.lang.String type,
int scale,
boolean cs)
StringBuilder based on its name, type, scale,
and case-sensitiveness.
This dialect uses the computed columns for all columns which are components of an index in order to
implement 'nulls last' idiom. It writes the computed column as:
"<name>__null boolean generated always as (<name> is null) virtual"
Note:
Improvement: if the field/column is mandatory, this augmentation is NOT necessary.
getComputedColumnString in class Dialectname - The original column name.type - The original column type.scale - The optional scale, if needed.cs - The case-sensitiveness.public int orderByNulls(java.lang.StringBuilder sb,
java.lang.String expression,
java.lang.String field,
boolean asc,
boolean forceAsc)
orderByNulls in class Dialectsb - The StringBuilder which contains the SQL statement to be built.expression - The field name (or expression) which is the current criterion to be augmented.field - The field name which is the base of the previous parameter (possible null).asc - The sort direction.forceAsc - If true, force the insertion of the default asc direction.protected CentralLogger getLog()
getLog in class MariaDbLenientDialect