public class DialectDB2 extends Dialect
Dialect.ArraySubQuery, Dialect.DialectIdType, Dialect.FulltextMatchInfo, Dialect.JDBCInfo
Modifier and Type | Field and Description |
---|---|
protected String |
fulltextParameters |
protected String |
usersSeparator |
aclOptimizationsEnabled, 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 |
---|
DialectDB2(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.
|
boolean |
doesUpdateFromRepeatSelf()
When doing an UPDATE t SET ...
|
String |
getCascadeDropConstraintsString() |
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.
|
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 |
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 |
getTestSQLStatementsFilename() |
String |
getUsersSeparator() |
String |
getValidationQuery()
A query that, when executed, will make at least a round-trip to the server to check that the connection is alive.
|
boolean |
isAllowedConversion(int expected,
int actual,
String actualName,
int actualSize)
Check mismatches between expected and actual JDBC types read from database introspection.
|
boolean |
isClusteringSupported()
Checks that clustering is supported.
|
void |
setToPreparedStatement(PreparedStatement ps,
int index,
Serializable value,
Column column) |
boolean |
supportsPaging()
Indicates if dialect supports paging
|
boolean |
supportsReadAcl()
Does the dialect support an optimized read security checks
|
boolean |
supportsUpdateFrom()
Does the dialect support UPDATE t SET ...
|
castIdToVarchar, closeQuote, createArrayOf, createDialect, getAddColumnString, getAddForeignKeyConstraintString, getAddPrimaryKeyConstraintString, getAncestorsIdsSql, getArrayElementString, getArrayIlikeSql, getArrayInSql, getArrayLikeSql, getArrayResult, getArraySubQuery, getBinaryFulltextSql, getBlobLengthFunction, getCalendarFromTimestamp, getCalendarFromTimestamp, getClobCast, getClusterGetInvalidations, getClusterInsertInvalidations, getColumnName, getConnectionSchema, getCreateIndexSql, getCustomColumnDefinition, getCustomPostCreateSqls, getDateCast, getDescending, getDumpStart, getDumpStop, getForeignKeyConstraintName, getFreeVariableSetterForType, getFromResultSetString, getFromResultSetTimestamp, getFulltextType, getGeneratedId, getIdentityGeneratedKeySql, getIdType, getIgnoredColumns, getIndexName, getLikeEscaping, getMatchMixinType, getMaximumArgsForIn, getMaxIndexNameSize, getNoColumnsInsertString, getNullColumnString, getPostCreateIdentityColumnSql, getPrepareUserReadAclsSql, getPrimaryKeyConstraintName, getReadAclsCheckSql, getRebuildReadAclsSql, getSoftDeleteCleanupSql, getSoftDeleteSql, getSQLForDump, getStartupSqls, getTableName, getTableTypeString, getTimestampFromCalendar, getTimestampFromCalendar, getUpdateReadAclsSql, hasIdentityGeneratedKey, hasNullEmptyString, isClusteringDeleteNeeded, isConcurrentUpdateException, isIdentityAlreadyPrimary, jdbcInfo, jdbcInfo, jdbcInfo, jdbcInfo, makeName, makeName, needsAliasForDerivedTable, needsNullsLastOnDescSort, needsOracleJoins, needsOrderByKeysAfterDistinct, needsOriginalColumnInGroupBy, needsPrepareUserReadAcls, openQuote, performAdditionalStatements, performPostOpenStatements, qualifyIndexName, setId, setIdLong, setToPreparedStatementString, setToPreparedStatementTimestamp, storesUpperCaseIdentifiers, supportsAncestorsTable, supportsArrayColumns, supportsArrays, supportsArraysReturnInsteadOfRows, supportsBatchUpdateCount, supportsCircularCascadeDeleteConstraints, supportsFastDescendants, supportsIfExistsAfterTableName, supportsIfExistsBeforeTableName, supportsIlike, supportsMultipleFulltextIndexes, supportsScroll, supportsSysNameArray, supportsWith, toBooleanValueString, toHexString
protected final String fulltextParameters
protected String usersSeparator
public DialectDB2(DatabaseMetaData metadata, RepositoryDescriptor repositoryDescriptor)
public String getCascadeDropConstraintsString()
getCascadeDropConstraintsString
in class Dialect
public Dialect.JDBCInfo getJDBCTypeAndString(ColumnType type)
Dialect
getJDBCTypeAndString
in class Dialect
public boolean isAllowedConversion(int expected, int actual, String actualName, int actualSize)
Dialect
isAllowedConversion
in class Dialect
public void setToPreparedStatement(PreparedStatement ps, int index, Serializable value, Column column) throws SQLException
setToPreparedStatement
in class Dialect
SQLException
public Serializable getFromResultSet(ResultSet rs, int index, Column column) throws SQLException
getFromResultSet
in class Dialect
SQLException
protected int getMaxNameSize()
getMaxNameSize
in class Dialect
public boolean supportsReadAcl()
Dialect
supportsReadAcl
in class Dialect
public boolean isClusteringSupported()
Dialect
isClusteringSupported
in class Dialect
public boolean supportsPaging()
Dialect
supportsPaging
in class Dialect
public String addPagingClause(String sql, long limit, long offset)
Dialect
addPagingClause
in class Dialect
public String getSQLStatementsFilename()
Dialect
getSQLStatementsFilename
in class Dialect
public String getTestSQLStatementsFilename()
getTestSQLStatementsFilename
in class Dialect
public Map<String,Serializable> getSQLStatementsProperties(Model model, Database database)
Dialect
getSQLStatementsProperties
in class Dialect
public String getValidationQuery()
Dialect
The query should throw an error if the connection is dead.
getValidationQuery
in class Dialect
public String getUsersSeparator()
public int getFulltextIndexedColumns()
Dialect
getFulltextIndexedColumns
in class Dialect
public boolean getMaterializeFulltextSyntheticColumn()
Dialect
getMaterializeFulltextSyntheticColumn
in class Dialect
public String getCreateFulltextIndexSql(String indexName, String quotedIndexName, Table table, List<Column> columns, Model model)
Dialect
getCreateFulltextIndexSql
in class Dialect
public String getDialectFulltextQuery(String query)
Dialect
getDialectFulltextQuery
in class Dialect
query
- the CMIS-syntax-based fulltext query stringpublic Dialect.FulltextMatchInfo getFulltextScoredMatchInfo(String fulltextQuery, String indexName, int nthMatch, Column mainColumn, Model model, Database database)
Dialect
getFulltextScoredMatchInfo
in class Dialect
public boolean supportsUpdateFrom()
Dialect
supportsUpdateFrom
in class Dialect
public boolean doesUpdateFromRepeatSelf()
Dialect
doesUpdateFromRepeatSelf
in class Dialect
public String getSecurityCheckSql(String idColumnName)
Dialect
getSecurityCheckSql
in class Dialect
idColumnName
- the quoted name of the id column to usepublic String getInTreeSql(String idColumnName, String id)
Dialect
getInTreeSql
in class Dialect
idColumnName
- 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 List<String> checkStoredProcedure(String procName, String procCreate, String ddlMode, Connection connection, JDBCLogger logger, Map<String,Serializable> properties) throws SQLException
Dialect
There 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 Dialect
procName
- the stored procedure nameprocCreate
- the creation SQL for the stored procedureddlMode
- the DDL modeconnection
- the connectionlogger
- the loggerproperties
- the statement execution propertiesSQLException
Copyright © 2017 Nuxeo. All rights reserved.