Nuxeo Enterprise Platform 5.4

org.nuxeo.ecm.core.storage.sql.jdbc.dialect
Class DialectOracle

java.lang.Object
  extended by org.nuxeo.ecm.core.storage.sql.jdbc.dialect.Dialect
      extended by org.nuxeo.ecm.core.storage.sql.jdbc.dialect.DialectOracle

public class DialectOracle
extends Dialect

Oracle-specific dialect.

Author:
Florent Guillaume

Nested Class Summary
 
Nested classes/interfaces inherited from class org.nuxeo.ecm.core.storage.sql.jdbc.dialect.Dialect
Dialect.FulltextMatchInfo, Dialect.FulltextQuery, Dialect.FulltextQueryAnalyzer, Dialect.JDBCInfo
 
Constructor Summary
DialectOracle(java.sql.DatabaseMetaData metadata, BinaryManager binaryManager, RepositoryDescriptor repositoryDescriptor)
           
 
Method Summary
 boolean connectionClosedByException(java.lang.Throwable t)
          Checks if an exception received means that the low level connection has been trashed and must be reset.
 java.sql.Array createArrayOf(int type, java.lang.Object[] elements, java.sql.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 ...
 java.lang.String getAddColumnString()
           
 java.lang.String getCascadeDropConstraintsString()
           
 java.lang.String getClobCast(boolean inOrderBy)
          When using a CLOB field in an expression, is some casting required and with what pattern?
 java.lang.String getClusterDeleteInvalidations()
          Gets the SQL to delete invalidations for this cluster node.
 java.lang.String getClusterGetInvalidations()
          Gets the SQL to query invalidations for this cluster node.
 java.lang.String getClusterInsertInvalidations()
          Gets the SQL to send an invalidation to the cluster.
 java.lang.String getConnectionSchema(java.sql.Connection connection)
          Gets the schema to use to query metadata about existing tables.
 java.lang.String getCreateFulltextIndexSql(java.lang.String indexName, java.lang.String quotedIndexName, Table table, java.util.List<Column> columns, Model model)
          Gets a CREATE INDEX statement for a fulltext index.
 java.lang.String getDialectFulltextQuery(java.lang.String query)
          Get the dialect-specific version of a fulltext query.
 java.io.Serializable getFromResultSet(java.sql.ResultSet rs, int index, Column column)
           
 int getFulltextIndexedColumns()
          Specifies what columns of the fulltext table have to be indexed.
 Dialect.FulltextMatchInfo getFulltextScoredMatchInfo(java.lang.String fulltextQuery, java.lang.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.
 java.lang.String getInTreeSql(java.lang.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.
 java.lang.String getReadAclsCheckSql(java.lang.String idColumnName)
          Gets the expression to check if access is allowed using read acl the dialect must suppportsReadAcl
 java.lang.String getRebuildReadAclsSql()
          Gets the statement to rebuild the wall read acls
 java.lang.String getSecurityCheckSql(java.lang.String idColumnName)
          Gets the expression to use to check security.
 java.lang.String getSQLStatementsFilename()
          Gets the name of the file containing the SQL statements.
 java.util.Map<java.lang.String,java.io.Serializable> getSQLStatementsProperties(Model model, Database database)
          Gets the properties to use with the SQL statements.
 java.lang.String getTestSQLStatementsFilename()
           
 java.lang.String getUpdateReadAclsSql()
          Gets the statement to update the read acls
 boolean isAllowedConversion(int expected, int actual, java.lang.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 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(java.sql.PreparedStatement ps, int index, java.io.Serializable value, Column column)
           
 boolean supportsArrays()
          Does the dialect support passing ARRAY values (to stored procedures mostly).
 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.
 
Methods inherited from class org.nuxeo.ecm.core.storage.sql.jdbc.dialect.Dialect
analyzeFulltextQuery, closeQuote, createDialect, existingTableDetected, fulltextHasPhrase, getAddForeignKeyConstraintString, getAddPrimaryKeyConstraintString, getBinaryManager, getCreateIndexSql, getForeignKeyConstraintName, getFreeVariableSetterForType, getFulltextType, getIndexName, getNoColumnsInsertString, getNullColumnString, getPagingClause, getPostCreateTableSqls, getTableTypeString, jdbcInfo, needsAliasForDerivedTable, needsOrderByKeysAfterDistinct, openQuote, performAdditionalStatements, preCreateTable, qualifyIndexName, storesUpperCaseIdentifiers, supportsAncestorsTable, supportsCircularCascadeDeleteConstraints, supportsIfExistsAfterTableName, supportsIfExistsBeforeTableName, supportsIlike, supportsMultipleFulltextIndexes, supportsPaging, toBooleanValueString, toHexString, translateFulltext
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DialectOracle

public DialectOracle(java.sql.DatabaseMetaData metadata,
                     BinaryManager binaryManager,
                     RepositoryDescriptor repositoryDescriptor)
              throws StorageException
Throws:
StorageException
Method Detail

getConnectionSchema

public java.lang.String getConnectionSchema(java.sql.Connection connection)
                                     throws java.sql.SQLException
Description copied from class: Dialect
Gets the schema to use to query metadata about existing tables.

Overrides:
getConnectionSchema in class Dialect
Throws:
java.sql.SQLException

getCascadeDropConstraintsString

public java.lang.String getCascadeDropConstraintsString()
Overrides:
getCascadeDropConstraintsString in class Dialect

getAddColumnString

public java.lang.String getAddColumnString()
Overrides:
getAddColumnString in class Dialect

getJDBCTypeAndString

public Dialect.JDBCInfo getJDBCTypeAndString(ColumnType type)
Description copied from class: Dialect
Gets the JDBC type and string from Nuxeo's type abstraction.

Specified by:
getJDBCTypeAndString in class Dialect

isAllowedConversion

public boolean isAllowedConversion(int expected,
                                   int actual,
                                   java.lang.String actualName,
                                   int actualSize)
Description copied from class: Dialect
Check mismatches between expected and actual JDBC types read from database introspection.

Overrides:
isAllowedConversion in class Dialect

setToPreparedStatement

public void setToPreparedStatement(java.sql.PreparedStatement ps,
                                   int index,
                                   java.io.Serializable value,
                                   Column column)
                            throws java.sql.SQLException
Specified by:
setToPreparedStatement in class Dialect
Throws:
java.sql.SQLException

getFromResultSet

public java.io.Serializable getFromResultSet(java.sql.ResultSet rs,
                                             int index,
                                             Column column)
                                      throws java.sql.SQLException
Specified by:
getFromResultSet in class Dialect
Throws:
java.sql.SQLException

getCreateFulltextIndexSql

public java.lang.String getCreateFulltextIndexSql(java.lang.String indexName,
                                                  java.lang.String quotedIndexName,
                                                  Table table,
                                                  java.util.List<Column> columns,
                                                  Model model)
Description copied from class: Dialect
Gets a CREATE INDEX statement for a fulltext index.

Specified by:
getCreateFulltextIndexSql in class Dialect

getDialectFulltextQuery

public java.lang.String getDialectFulltextQuery(java.lang.String query)
Description copied from class: Dialect
Get the dialect-specific version of a fulltext query.

Specified by:
getDialectFulltextQuery in class Dialect
Parameters:
query - the CMIS-syntax-based fulltext query string
Returns:
the dialect native fulltext query string

getFulltextScoredMatchInfo

public Dialect.FulltextMatchInfo getFulltextScoredMatchInfo(java.lang.String fulltextQuery,
                                                            java.lang.String indexName,
                                                            int nthMatch,
                                                            Column mainColumn,
                                                            Model model,
                                                            Database database)
Description copied from class: Dialect
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.

Specified by:
getFulltextScoredMatchInfo in class Dialect

getMaterializeFulltextSyntheticColumn

public boolean getMaterializeFulltextSyntheticColumn()
Description copied from class: Dialect
Does the fulltext synthetic column have to be materialized.

Specified by:
getMaterializeFulltextSyntheticColumn in class Dialect

getFulltextIndexedColumns

public int getFulltextIndexedColumns()
Description copied from class: Dialect
Specifies what columns of the fulltext table have to be indexed.

Specified by:
getFulltextIndexedColumns in class Dialect
Returns:
0 for none, 1 for the synthetic one, 2 for the individual ones

supportsUpdateFrom

public boolean supportsUpdateFrom()
Description copied from class: Dialect
Does the dialect support UPDATE t SET ... FROM t, u WHERE ... ?

Specified by:
supportsUpdateFrom in class Dialect

doesUpdateFromRepeatSelf

public boolean doesUpdateFromRepeatSelf()
Description copied from class: Dialect
When doing an UPDATE t SET ... FROM t, u WHERE ..., does the FROM clause need to repeate the updated table (t).

Specified by:
doesUpdateFromRepeatSelf in class Dialect

needsOriginalColumnInGroupBy

public boolean needsOriginalColumnInGroupBy()
Description copied from class: Dialect
Whether a GROUP BY can only be used with the original column name and not an alias.

Overrides:
needsOriginalColumnInGroupBy in class Dialect

needsOracleJoins

public boolean needsOracleJoins()
Description copied from class: Dialect
Whether implicit Oracle joins (instead of explicit ANSI joins) are needed.

Overrides:
needsOracleJoins in class Dialect

getClobCast

public java.lang.String getClobCast(boolean inOrderBy)
Description copied from class: Dialect
When using a CLOB field in an expression, is some casting required and with what pattern?

Needed for Derby and H2.

Overrides:
getClobCast in class Dialect
Parameters:
inOrderBy - true if the expression is for an ORDER BY column
Returns:
a pattern for String.format with one parameter for the column name and one for the width, or null if no cast is required

supportsReadAcl

public boolean supportsReadAcl()
Description copied from class: Dialect
Does the dialect support an optimized read security checks

Overrides:
supportsReadAcl in class Dialect

getReadAclsCheckSql

public java.lang.String getReadAclsCheckSql(java.lang.String idColumnName)
Description copied from class: Dialect
Gets the expression to check if access is allowed using read acl the dialect must suppportsReadAcl

Overrides:
getReadAclsCheckSql in class Dialect
Parameters:
idColumnName - the quoted name of the read acl_id column to use
Returns:
an SQL expression with one parameter (principals) that is true if access is allowed

getUpdateReadAclsSql

public java.lang.String getUpdateReadAclsSql()
Description copied from class: Dialect
Gets the statement to update the read acls

Overrides:
getUpdateReadAclsSql in class Dialect

getRebuildReadAclsSql

public java.lang.String getRebuildReadAclsSql()
Description copied from class: Dialect
Gets the statement to rebuild the wall read acls

Overrides:
getRebuildReadAclsSql in class Dialect

getSecurityCheckSql

public java.lang.String getSecurityCheckSql(java.lang.String idColumnName)
Description copied from class: Dialect
Gets the expression to use to check security.

Specified by:
getSecurityCheckSql in class Dialect
Parameters:
idColumnName - the quoted name of the id column to use
Returns:
an SQL expression with two parameters (principals and permissions) that is true if access is allowed

getInTreeSql

public java.lang.String getInTreeSql(java.lang.String idColumnName)
Description copied from class: Dialect
Gets the expression to use to check tree membership.

Specified by:
getInTreeSql in class Dialect
Parameters:
idColumnName - the quoted name of the id column to use
Returns:
an SQL expression with one parameters for the based id that is true if the document is under base id

isClusteringSupported

public boolean isClusteringSupported()
Description copied from class: Dialect
Checks that clustering is supported.

Overrides:
isClusteringSupported in class Dialect

isClusteringDeleteNeeded

public boolean isClusteringDeleteNeeded()
Description copied from class: Dialect
Does clustering fetch of invalidations ( Dialect.getClusterGetInvalidations()) need a separate delete for them ( Dialect.getClusterDeleteInvalidations()).

Overrides:
isClusteringDeleteNeeded in class Dialect

getClusterInsertInvalidations

public java.lang.String getClusterInsertInvalidations()
Description copied from class: Dialect
Gets the SQL to send an invalidation to the cluster.

Overrides:
getClusterInsertInvalidations in class Dialect
Returns:
an SQL statement with parameters for: id, fragments, kind

getClusterGetInvalidations

public java.lang.String getClusterGetInvalidations()
Description copied from class: Dialect
Gets the SQL to query invalidations for this cluster node.

Overrides:
getClusterGetInvalidations in class Dialect
Returns:
an SQL statement returning a result set

getClusterDeleteInvalidations

public java.lang.String getClusterDeleteInvalidations()
Description copied from class: Dialect
Gets the SQL to delete invalidations for this cluster node.

Overrides:
getClusterDeleteInvalidations in class Dialect
Returns:
an SQL statement returning a result set

supportsWith

public boolean supportsWith()
Description copied from class: Dialect
Does the dialect support SQL-99 WITH common table expressions.

Overrides:
supportsWith in class Dialect

supportsArrays

public boolean supportsArrays()
Description copied from class: Dialect
Does the dialect support passing ARRAY values (to stored procedures mostly).

If not, we'll simulate them using a string and a separator.

Overrides:
supportsArrays in class Dialect
Returns:
true if ARRAY values are supported

createArrayOf

public java.sql.Array createArrayOf(int type,
                                    java.lang.Object[] elements,
                                    java.sql.Connection connection)
                             throws java.sql.SQLException
Description copied from class: Dialect
Factory method for creating Array objects, suitable for passing to PreparedStatement.setArray(int, java.sql.Array).

(An equivalent method is defined by JDBC4 on the Connection class.)

Overrides:
createArrayOf in class Dialect
Parameters:
type - the SQL type of the elements
elements - the elements of the array
connection - the connection
Returns:
an Array holding the elements
Throws:
java.sql.SQLException

getSQLStatementsFilename

public java.lang.String getSQLStatementsFilename()
Description copied from class: Dialect
Gets the name of the file containing the SQL statements.

Specified by:
getSQLStatementsFilename in class Dialect

getTestSQLStatementsFilename

public java.lang.String getTestSQLStatementsFilename()
Specified by:
getTestSQLStatementsFilename in class Dialect

getSQLStatementsProperties

public java.util.Map<java.lang.String,java.io.Serializable> getSQLStatementsProperties(Model model,
                                                                                       Database database)
Description copied from class: Dialect
Gets the properties to use with the SQL statements.

Specified by:
getSQLStatementsProperties in class Dialect

connectionClosedByException

public boolean connectionClosedByException(java.lang.Throwable t)
Description copied from class: Dialect
Checks if an exception received means that the low level connection has been trashed and must be reset.

Overrides:
connectionClosedByException in class Dialect

Nuxeo Enterprise Platform 5.4

Copyright © 2010 Nuxeo SAS. All Rights Reserved.