public class DialectOracle extends Dialect
Dialect.DialectIdType, Dialect.FulltextMatchInfo, Dialect.FulltextQuery, Dialect.FulltextQueryAnalyzer, Dialect.JDBCInfo
ARRAY_SEP, DEBUG_REAL_UUIDS, DEBUG_UUIDS, DIALECT_CLASS, DIALECTS
Constructor and Description |
---|
DialectOracle(DatabaseMetaData metadata,
BinaryManager binaryManager,
RepositoryDescriptor repositoryDescriptor) |
Modifier and Type | Method and Description |
---|---|
String |
addPagingClause(String sql,
long limit,
long offset)
Returns the SQL query with a paging clause
|
Array |
createArrayOf(int type,
Object[] elements,
Connection connection)
Factory method for creating Array objects, suitable for passing to
PreparedStatement.setArray(int, java.sql.Array) . |
boolean |
doesUpdateFromRepeatSelf()
When doing an UPDATE t SET ...
|
String |
getAddColumnString() |
String |
getAncestorsIdsSql()
Gets the SQL query to get the ancestors of a set of ids.
|
String |
getBlobLengthFunction()
Gets the SQL function that returns the length of a blob, in bytes.
|
String |
getCascadeDropConstraintsString() |
String |
getClobCast(boolean inOrderBy)
When using a CLOB field in an expression, is some casting required and
with what pattern?
|
String |
getClusterDeleteInvalidations()
Gets the SQL to delete invalidations for this cluster node.
|
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 |
getClusterNodeIdSql()
Returns the cluster node id, for some databases where this info is needed
at the Java level.
|
String |
getConnectionSchema(Connection connection)
Gets the schema to use to query metadata about existing tables.
|
String |
getCreateFulltextIndexSql(String indexName,
String quotedIndexName,
Table table,
List<Column> columns,
Model model)
Gets a CREATE INDEX statement for a fulltext index.
|
String |
getDateCast()
Get the expression to use to cast a column to a DATE type.
|
String |
getDescending()
Gets the SQL descending sort direction with option to sort nulls last.
|
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 |
getIdentityGeneratedKeySql(Column column)
Gets the SQL query to execute to retrieve the last generated identity
key.
|
String |
getInTreeSql(String idColumnName)
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.
|
List<String> |
getPostCreateIdentityColumnSql(Column column)
Gets additional SQL statements to execute after the CREATE TABLE when
creating an identity column.
|
String |
getReadAclsCheckSql(String idColumnName)
Gets the expression to check if access is allowed using read acl the
dialect must suppportsReadAcl
|
String |
getRebuildReadAclsSql()
Gets the statement to rebuild the wall read acls
|
String |
getSecurityCheckSql(String idColumnName)
Gets the expression to use to check security.
|
String |
getSoftDeleteCleanupSql()
SQL to clean soft-delete documents.
|
String |
getSoftDeleteSql()
SQL to soft delete documents.
|
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 |
getUpdateReadAclsSql()
Gets the statement to update the read acls
|
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 |
hasIdentityGeneratedKey()
True if the dialect returns the generated key for the identity from the
insert statement.
|
boolean |
hasNullEmptyString()
Does the dialect have an empty string identical to NULL (Oracle).
|
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 (
Dialect.getClusterDeleteInvalidations() ). |
boolean |
isClusteringSupported()
Checks that clustering is supported.
|
boolean |
isConnectionClosedException(Throwable t)
Checks if an exception received means that the low level connection has
been trashed and must be reset.
|
boolean |
needsOracleJoins()
Whether implicit Oracle joins (instead of explicit ANSI joins) are
needed.
|
boolean |
needsOriginalColumnInGroupBy()
Whether a GROUP BY can only be used with the original column name and not
an alias.
|
void |
setToPreparedStatement(PreparedStatement ps,
int index,
Serializable value,
Column column) |
boolean |
supportsArrays()
Does the dialect support passing ARRAY values (to stored procedures
mostly).
|
boolean |
supportsArraysReturnInsteadOfRows()
Does a stored function returning an result set need to access it as a
single array instead of iterating over a normal result set's rows.
|
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 ...
|
boolean |
supportsWith()
Does the dialect support SQL-99 WITH common table expressions.
|
analyzeFulltextQuery, castIdToVarchar, closeQuote, createDialect, existingTableDetected, fulltextHasPhrase, getAddForeignKeyConstraintString, getAddPrimaryKeyConstraintString, getBinaryManager, getColumnName, getCreateIndexSql, getCustomColumnDefinition, getCustomPostCreateSqls, getForeignKeyConstraintName, getFreeVariableSetterForType, getFulltextType, getGeneratedId, getIdType, getIgnoredColumns, getIndexName, getMatchMixinType, getMaximumArgsForIn, getNoColumnsInsertString, getNullColumnString, getPostCreateTableSqls, getPrepareUserReadAclsSql, getPrimaryKeyConstraintName, getTableName, getTableTypeString, isConcurrentUpdateException, isIdentityAlreadyPrimary, jdbcInfo, jdbcInfo, needsAliasForDerivedTable, needsOrderByKeysAfterDistinct, needsPrepareUserReadAcls, openQuote, performAdditionalStatements, performPostOpenStatements, preCreateTable, qualifyIndexName, setId, setIdLong, setToPreparedStatementTimestamp, storesUpperCaseIdentifiers, supportsAncestorsTable, supportsCircularCascadeDeleteConstraints, supportsConcurrentUpdateReadAcls, supportsIfExistsAfterTableName, supportsIfExistsBeforeTableName, supportsIlike, supportsMultipleFulltextIndexes, supportsSysNameArray, toBooleanValueString, toHexString, translateFulltext, translateFulltext
public DialectOracle(DatabaseMetaData metadata, BinaryManager binaryManager, RepositoryDescriptor repositoryDescriptor) throws StorageException
StorageException
public String getConnectionSchema(Connection connection) throws SQLException
Dialect
getConnectionSchema
in class Dialect
SQLException
public String getCascadeDropConstraintsString()
getCascadeDropConstraintsString
in class Dialect
public String getAddColumnString()
getAddColumnString
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
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 getMaterializeFulltextSyntheticColumn()
Dialect
getMaterializeFulltextSyntheticColumn
in class Dialect
public int getFulltextIndexedColumns()
Dialect
getFulltextIndexedColumns
in class Dialect
public boolean supportsUpdateFrom()
Dialect
supportsUpdateFrom
in class Dialect
public boolean doesUpdateFromRepeatSelf()
Dialect
doesUpdateFromRepeatSelf
in class Dialect
public boolean needsOriginalColumnInGroupBy()
Dialect
needsOriginalColumnInGroupBy
in class Dialect
public boolean needsOracleJoins()
Dialect
needsOracleJoins
in class Dialect
public String getClobCast(boolean inOrderBy)
Dialect
Needed for Derby and H2.
getClobCast
in class Dialect
inOrderBy
- true
if the expression is for an ORDER BY columnnull
if no cast is
requiredpublic boolean supportsReadAcl()
Dialect
supportsReadAcl
in class Dialect
public String getReadAclsCheckSql(String idColumnName)
Dialect
getReadAclsCheckSql
in class Dialect
idColumnName
- the quoted name of the read acl_id column to usepublic String getUpdateReadAclsSql()
Dialect
getUpdateReadAclsSql
in class Dialect
public String getRebuildReadAclsSql()
Dialect
getRebuildReadAclsSql
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)
Dialect
getInTreeSql
in class Dialect
idColumnName
- the quoted name of the id column to usepublic boolean isClusteringSupported()
Dialect
isClusteringSupported
in class Dialect
public String getClusterNodeIdSql()
Dialect
getClusterNodeIdSql
in class Dialect
public boolean isClusteringDeleteNeeded()
Dialect
Dialect.getClusterGetInvalidations()
) need a separate delete for them (
Dialect.getClusterDeleteInvalidations()
).isClusteringDeleteNeeded
in class Dialect
public String getClusterInsertInvalidations()
Dialect
getClusterInsertInvalidations
in class Dialect
public String getClusterGetInvalidations()
Dialect
getClusterGetInvalidations
in class Dialect
public String getClusterDeleteInvalidations()
Dialect
getClusterDeleteInvalidations
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 boolean supportsWith()
Dialect
supportsWith
in class Dialect
public boolean supportsArrays()
Dialect
If not, we'll simulate them using a string and a separator.
supportsArrays
in class Dialect
public boolean supportsArraysReturnInsteadOfRows()
Dialect
Oracle needs this.
supportsArraysReturnInsteadOfRows
in class Dialect
public boolean hasNullEmptyString()
Dialect
hasNullEmptyString
in class Dialect
public Array createArrayOf(int type, Object[] elements, Connection connection) throws SQLException
Dialect
PreparedStatement.setArray(int, java.sql.Array)
.
(An equivalent method is defined by JDBC4 on the Connection
class.)
createArrayOf
in class Dialect
type
- the SQL type of the elementselements
- the elements of the arrayconnection
- the connectionSQLException
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 boolean isConnectionClosedException(Throwable t)
Dialect
isConnectionClosedException
in class Dialect
public String getValidationQuery()
Dialect
The query should throw an error if the connection is dead.
getValidationQuery
in class Dialect
public String getBlobLengthFunction()
Dialect
getBlobLengthFunction
in class Dialect
public List<String> getPostCreateIdentityColumnSql(Column column)
Dialect
Oracle needs both a sequence and a trigger.
getPostCreateIdentityColumnSql
in class Dialect
public boolean hasIdentityGeneratedKey()
Dialect
Oracle needs a separate call to CURRVAL.
hasIdentityGeneratedKey
in class Dialect
public String getIdentityGeneratedKeySql(Column column)
Dialect
Oracle needs a separate call to CURRVAL.
getIdentityGeneratedKeySql
in class Dialect
public String getAncestorsIdsSql()
Dialect
getAncestorsIdsSql
in class Dialect
public String getDescending()
Dialect
getDescending
in class Dialect
public String getDateCast()
Dialect
getDateCast
in class Dialect
public String getUsersSeparator()
public String getSoftDeleteSql()
Dialect
getSoftDeleteSql
in class Dialect
public String getSoftDeleteCleanupSql()
Dialect
getSoftDeleteCleanupSql
in class Dialect
Copyright © 2013 Nuxeo SA. All Rights Reserved.