public class DialectMySQL extends Dialect
Dialect.ArraySubQuery, Dialect.DialectIdType, Dialect.FulltextMatchInfo, Dialect.JDBCInfoaclOptimizationsEnabled, ARRAY_SEP, clusteringEnabled, DEBUG_REAL_UUIDS, DEBUG_UUIDS, descending, DIALECT_CLASS, DIALECTS, fulltextDisabled, fulltextSearchDisabled, HEX_DIGITS, NULLS_LAST_ON_DESC_PROP, proxiesEnabled, readAclMaxSize, softDeleteEnabled, storesUpperCaseIdentifiers| Constructor and Description |
|---|
DialectMySQL(DatabaseMetaData metadata,
RepositoryDescriptor repositoryDescriptor) |
| Modifier and Type | Method and Description |
|---|---|
String |
addPagingClause(String sql,
long limit,
long offset)
Returns the SQL query with a paging clause
|
List<String> |
checkStoredProcedure(String procName,
String procCreate,
String ddlMode,
Connection connection,
JDBCLogger logger,
Map<String,Serializable> properties)
Checks if a given stored procedure exists and is identical to the passed creation SQL.
|
char |
closeQuote() |
boolean |
doesUpdateFromRepeatSelf()
When doing an UPDATE t SET ...
|
String |
getAddForeignKeyConstraintString(String constraintName,
String[] foreignKeys,
String referencedTable,
String[] primaryKeys,
boolean referencesPrimaryKey) |
String |
getBinaryFulltextSql(List<String> columns)
Return the SQL to get the columns fulltext fields
|
String |
getClusterGetInvalidations()
Gets the SQL to query invalidations for this cluster node.
|
String |
getClusterInsertInvalidations()
Gets the SQL to send an invalidation to the cluster.
|
String |
getCreateFulltextIndexSql(String indexName,
String quotedIndexName,
Table table,
List<Column> columns,
Model model)
Gets a CREATE INDEX statement for a fulltext index.
|
String |
getDialectFulltextQuery(String query)
Get the dialect-specific version of a fulltext query.
|
Collection<? extends String> |
getDumpStart()
Returns the initial DDL statements to add to a DDL dump.
|
Collection<? extends String> |
getDumpStop()
Returns the final DDL statements to add to a DDL dump.
|
Serializable |
getFromResultSet(ResultSet rs,
int index,
Column column) |
int |
getFulltextIndexedColumns()
Specifies what columns of the fulltext table have to be indexed.
|
Dialect.FulltextMatchInfo |
getFulltextScoredMatchInfo(String fulltextQuery,
String indexName,
int nthMatch,
Column mainColumn,
Model model,
Database database)
Gets the SQL information needed to do a a fulltext match, either with a direct expression in the WHERE clause, or
using a join with an additional table.
|
String |
getInTreeSql(String idColumnName,
String id)
Gets the expression to use to check tree membership.
|
Dialect.JDBCInfo |
getJDBCTypeAndString(ColumnType type)
Gets the JDBC type and string from Nuxeo's type abstraction.
|
boolean |
getMaterializeFulltextSyntheticColumn()
Does the fulltext synthetic column have to be materialized.
|
protected int |
getMaxNameSize() |
String |
getSecurityCheckSql(String idColumnName)
Gets the expression to use to check security.
|
String |
getSQLForDump(String sql)
Returns the SQL statement with proper terminator to use in a dump.
|
String |
getSQLStatementsFilename()
Gets the name of the file containing the SQL statements.
|
Map<String,Serializable> |
getSQLStatementsProperties(Model model,
Database database)
Gets the properties to use with the SQL statements.
|
String |
getTableTypeString(Table table) |
String |
getTestSQLStatementsFilename() |
boolean |
isAllowedConversion(int expected,
int actual,
String actualName,
int actualSize)
Check mismatches between expected and actual JDBC types read from database introspection.
|
boolean |
isClusteringDeleteNeeded()
Does clustering fetch of invalidations (
Dialect.getClusterGetInvalidations()) need a separate delete for them. |
boolean |
isClusteringSupported()
Checks that clustering is supported.
|
boolean |
isConcurrentUpdateException(Throwable t)
Checks if an exception received means that a concurrent update was detected.
|
boolean |
isIdentityAlreadyPrimary()
Checks if an identity column is already defined as a primary key and does not need a separate index added.
|
boolean |
needsAliasForDerivedTable()
Whether a derived table (subselect in a FROM statement) needs an alias.
|
boolean |
needsOrderByKeysAfterDistinct()
When doing a SELECT DISTINCT that uses a ORDER BY, do the keys along which we order have to be mentioned in the
DISTINCT clause?
|
protected static String |
normalizeString(String string) |
char |
openQuote() |
boolean |
qualifyIndexName() |
void |
setToPreparedStatement(PreparedStatement ps,
int index,
Serializable value,
Column column) |
boolean |
supportsIfExistsBeforeTableName() |
boolean |
supportsPaging()
Indicates if dialect supports paging
|
boolean |
supportsUpdateFrom()
Does the dialect support UPDATE t SET ...
|
protected static void |
translateForMySQL(FulltextQueryAnalyzer.FulltextQuery ft,
FulltextQueryAnalyzer.Op superOp,
StringBuilder buf) |
castIdToVarchar, createArrayOf, createDialect, getAddColumnString, getAddPrimaryKeyConstraintString, getAncestorsIdsSql, getArrayElementString, getArrayIlikeSql, getArrayInSql, getArrayLikeSql, getArrayResult, getArraySubQuery, getBlobLengthFunction, getCalendarFromTimestamp, getCalendarFromTimestamp, getCascadeDropConstraintsString, getClobCast, getColumnName, getConnectionSchema, getCreateIndexSql, getCustomColumnDefinition, getCustomPostCreateSqls, getDateCast, getDescending, getForeignKeyConstraintName, getFreeVariableSetterForType, getFromResultSetString, getFromResultSetTimestamp, getFulltextType, getGeneratedId, getIdentityGeneratedKeySql, getIdType, getIgnoredColumns, getIndexName, getLikeEscaping, getMatchMixinType, getMaximumArgsForIn, getMaxIndexNameSize, getNoColumnsInsertString, getNullColumnString, getPostCreateIdentityColumnSql, getPrepareUserReadAclsSql, getPrimaryKeyConstraintName, getReadAclsCheckSql, getRebuildReadAclsSql, getSoftDeleteCleanupSql, getSoftDeleteSql, getStartupSqls, getTableName, getTimestampFromCalendar, getTimestampFromCalendar, getUpdateReadAclsSql, getValidationQuery, hasIdentityGeneratedKey, hasNullEmptyString, jdbcInfo, jdbcInfo, jdbcInfo, jdbcInfo, makeName, makeName, needsNullsLastOnDescSort, needsOracleJoins, needsOriginalColumnInGroupBy, needsPrepareUserReadAcls, performAdditionalStatements, performPostOpenStatements, setId, setIdLong, setToPreparedStatementString, setToPreparedStatementTimestamp, storesUpperCaseIdentifiers, supportsAncestorsTable, supportsArrayColumns, supportsArrays, supportsArraysReturnInsteadOfRows, supportsCircularCascadeDeleteConstraints, supportsFastDescendants, supportsIfExistsAfterTableName, supportsIlike, supportsMultipleFulltextIndexes, supportsReadAcl, supportsSysNameArray, supportsWith, toBooleanValueString, toHexStringpublic DialectMySQL(DatabaseMetaData metadata, RepositoryDescriptor repositoryDescriptor)
public char closeQuote()
closeQuote in class Dialectpublic String getAddForeignKeyConstraintString(String constraintName, String[] foreignKeys, String referencedTable, String[] primaryKeys, boolean referencesPrimaryKey)
getAddForeignKeyConstraintString in class Dialectpublic boolean qualifyIndexName()
qualifyIndexName in class Dialectpublic boolean supportsIfExistsBeforeTableName()
supportsIfExistsBeforeTableName in class Dialectpublic Dialect.JDBCInfo getJDBCTypeAndString(ColumnType type)
DialectgetJDBCTypeAndString in class Dialectpublic boolean isAllowedConversion(int expected, int actual, String actualName, int actualSize)
DialectisAllowedConversion in class Dialectpublic void setToPreparedStatement(PreparedStatement ps, int index, Serializable value, Column column) throws SQLException
setToPreparedStatement in class DialectSQLExceptionpublic Serializable getFromResultSet(ResultSet rs, int index, Column column) throws SQLException
getFromResultSet in class DialectSQLExceptionprotected int getMaxNameSize()
getMaxNameSize in class Dialectpublic String getCreateFulltextIndexSql(String indexName, String quotedIndexName, Table table, List<Column> columns, Model model)
DialectgetCreateFulltextIndexSql in class Dialectpublic String getDialectFulltextQuery(String query)
DialectgetDialectFulltextQuery in class Dialectquery - the CMIS-syntax-based fulltext query stringprotected static void translateForMySQL(FulltextQueryAnalyzer.FulltextQuery ft, FulltextQueryAnalyzer.Op superOp, StringBuilder buf)
public Dialect.FulltextMatchInfo getFulltextScoredMatchInfo(String fulltextQuery, String indexName, int nthMatch, Column mainColumn, Model model, Database database)
DialectgetFulltextScoredMatchInfo in class Dialectpublic boolean getMaterializeFulltextSyntheticColumn()
DialectgetMaterializeFulltextSyntheticColumn in class Dialectpublic int getFulltextIndexedColumns()
DialectgetFulltextIndexedColumns in class Dialectpublic String getTableTypeString(Table table)
getTableTypeString in class Dialectpublic boolean supportsUpdateFrom()
DialectsupportsUpdateFrom in class Dialectpublic boolean doesUpdateFromRepeatSelf()
DialectdoesUpdateFromRepeatSelf in class Dialectpublic boolean needsOrderByKeysAfterDistinct()
DialectneedsOrderByKeysAfterDistinct in class Dialectpublic boolean needsAliasForDerivedTable()
DialectneedsAliasForDerivedTable in class Dialectpublic String getSecurityCheckSql(String idColumnName)
DialectgetSecurityCheckSql in class DialectidColumnName - the quoted name of the id column to usepublic String getInTreeSql(String idColumnName, String id)
DialectgetInTreeSql in class DialectidColumnName - the quoted name of the id column to useid - the id, to check syntax with respect to specialized id column typesnull if the query cannot matchpublic String getSQLStatementsFilename()
DialectgetSQLStatementsFilename in class Dialectpublic String getTestSQLStatementsFilename()
getTestSQLStatementsFilename in class Dialectpublic Map<String,Serializable> getSQLStatementsProperties(Model model, Database database)
DialectgetSQLStatementsProperties in class Dialectpublic boolean isConcurrentUpdateException(Throwable t)
DialectisConcurrentUpdateException in class Dialectpublic boolean isClusteringSupported()
DialectisClusteringSupported in class Dialectpublic boolean isClusteringDeleteNeeded()
DialectDialect.getClusterGetInvalidations()) need a separate delete for them.isClusteringDeleteNeeded in class Dialectpublic String getClusterInsertInvalidations()
DialectgetClusterInsertInvalidations in class Dialectpublic String getClusterGetInvalidations()
DialectgetClusterGetInvalidations in class Dialectpublic boolean supportsPaging()
DialectsupportsPaging in class Dialectpublic String addPagingClause(String sql, long limit, long offset)
DialectaddPagingClause in class Dialectpublic boolean isIdentityAlreadyPrimary()
DialectMySQL defines the identity column directly as primary key.
isIdentityAlreadyPrimary in class Dialectpublic String getBinaryFulltextSql(List<String> columns)
DialectgetBinaryFulltextSql in class Dialectpublic List<String> checkStoredProcedure(String procName, String procCreate, String ddlMode, Connection connection, JDBCLogger logger, Map<String,Serializable> properties) throws SQLException
DialectThere are 3 cases to deal with, and actions to perform:
When there is nothing to do, null is returned. Otherwise the returned value is a list of SQL statements
to execute. Note that the SQL statements will include also INSERT statements to be executed to remember the
creation SQL itself.
checkStoredProcedure in class DialectprocName - the stored procedure nameprocCreate - the creation SQL for the stored procedureddlMode - the DDL modeconnection - the connectionlogger - the loggerproperties - the statement execution propertiesSQLExceptionprotected static String normalizeString(String string)
public Collection<? extends String> getDumpStart()
DialectgetDumpStart in class Dialectpublic Collection<? extends String> getDumpStop()
DialectgetDumpStop in class Dialectpublic String getSQLForDump(String sql)
DialectgetSQLForDump in class DialectCopyright © 2016 Nuxeo SA. All rights reserved.