Nuxeo ECM Projects 5.4.3-SNAPSHOT

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

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

public class DialectDerby
extends Dialect

Derby-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
 
Field Summary
 
Fields inherited from class org.nuxeo.ecm.core.storage.sql.jdbc.dialect.Dialect
ARRAY_SEP
 
Constructor Summary
DialectDerby(DatabaseMetaData metadata, BinaryManager binaryManager, RepositoryDescriptor repositoryDescriptor)
           
 
Method Summary
 boolean doesUpdateFromRepeatSelf()
          When doing an UPDATE t SET ...
 String getClobCast(boolean inOrderBy)
          When using a CLOB field in an expression, is some casting required and with what pattern?
 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)
          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.
 String getPagingClause(long limit, long offset)
          Gets paging clause to be appended at the end of select statement
 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()
           
 boolean isAllowedConversion(int expected, int actual, String actualName, int actualSize)
          Check mismatches between expected and actual JDBC types read from database introspection.
 boolean needsAliasForDerivedTable()
          Whether a derived table (subselect in a FROM statement) needs an alias.
 void setToPreparedStatement(PreparedStatement ps, int index, Serializable value, Column column)
           
 boolean supportsPaging()
          Indicates if dialect supports paging
 boolean supportsUpdateFrom()
          Does the dialect support UPDATE t SET ...
 
Methods inherited from class org.nuxeo.ecm.core.storage.sql.jdbc.dialect.Dialect
analyzeFulltextQuery, closeQuote, createArrayOf, createDialect, existingTableDetected, fulltextHasPhrase, getAddColumnString, getAddForeignKeyConstraintString, getAddPrimaryKeyConstraintString, getAncestorsIdsSql, getBinaryManager, getBlobLengthFunction, getCascadeDropConstraintsString, getClusterDeleteInvalidations, getClusterGetInvalidations, getClusterInsertInvalidations, getColumnName, getConnectionSchema, getCreateIndexSql, getForeignKeyConstraintName, getFreeVariableSetterForType, getFulltextType, getIdentityGeneratedKeySql, getIndexName, getMatchMixinType, getMaximumArgsForIn, getNoColumnsInsertString, getNullColumnString, getPostCreateIdentityColumnSql, getPostCreateTableSqls, getPrepareUserReadAclsSql, getPrimaryKeyConstraintName, getReadAclsCheckSql, getRebuildReadAclsSql, getTableName, getTableTypeString, getUpdateReadAclsSql, getValidationQuery, hasIdentityGeneratedKey, hasNullEmptyString, isClusteringDeleteNeeded, isClusteringSupported, isConnectionClosedException, isIdentityAlreadyPrimary, jdbcInfo, jdbcInfo, needsOracleJoins, needsOrderByKeysAfterDistinct, needsOriginalColumnInGroupBy, needsPrepareUserReadAcls, openQuote, performAdditionalStatements, performPostOpenStatements, preCreateTable, qualifyIndexName, storesUpperCaseIdentifiers, supportsAncestorsTable, supportsArrays, supportsArraysReturnInsteadOfRows, supportsCircularCascadeDeleteConstraints, supportsIfExistsAfterTableName, supportsIfExistsBeforeTableName, supportsIlike, supportsMultipleFulltextIndexes, supportsReadAcl, supportsSysNameArray, supportsWith, toBooleanValueString, toHexString, translateFulltext
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DialectDerby

public DialectDerby(DatabaseMetaData metadata,
                    BinaryManager binaryManager,
                    RepositoryDescriptor repositoryDescriptor)
             throws StorageException
Throws:
StorageException
Method Detail

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,
                                   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(PreparedStatement ps,
                                   int index,
                                   Serializable value,
                                   Column column)
                            throws SQLException
Specified by:
setToPreparedStatement in class Dialect
Throws:
SQLException

getFromResultSet

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

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

getMaterializeFulltextSyntheticColumn

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

Specified by:
getMaterializeFulltextSyntheticColumn in class Dialect

getCreateFulltextIndexSql

public String getCreateFulltextIndexSql(String indexName,
                                        String quotedIndexName,
                                        Table table,
                                        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 String getDialectFulltextQuery(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(String fulltextQuery,
                                                            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

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

needsAliasForDerivedTable

public boolean needsAliasForDerivedTable()
Description copied from class: Dialect
Whether a derived table (subselect in a FROM statement) needs an alias.

Overrides:
needsAliasForDerivedTable in class Dialect

getClobCast

public 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

getSecurityCheckSql

public String getSecurityCheckSql(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 String getInTreeSql(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

getSQLStatementsFilename

public 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 String getTestSQLStatementsFilename()
Specified by:
getTestSQLStatementsFilename in class Dialect

getSQLStatementsProperties

public Map<String,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

supportsPaging

public boolean supportsPaging()
Description copied from class: Dialect
Indicates if dialect supports paging

Overrides:
supportsPaging in class Dialect
Returns:
true if the dialect supports paging

getPagingClause

public String getPagingClause(long limit,
                              long offset)
Description copied from class: Dialect
Gets paging clause to be appended at the end of select statement

Overrides:
getPagingClause in class Dialect

Nuxeo ECM Projects 5.4.3-SNAPSHOT

Copyright © 2011 Nuxeo SAS. All Rights Reserved.