|
Nuxeo ECM Projects 5.4.3-SNAPSHOT | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.nuxeo.ecm.core.storage.sql.jdbc.dialect.Dialect org.nuxeo.ecm.core.storage.sql.jdbc.dialect.DialectPostgreSQL
public class DialectPostgreSQL
PostgreSQL-specific dialect.
Nested Class Summary | |
---|---|
static class |
DialectPostgreSQL.PostgreSQLArray
|
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 | |
---|---|
DialectPostgreSQL(DatabaseMetaData metadata,
BinaryManager binaryManager,
RepositoryDescriptor repositoryDescriptor)
|
Method Summary | |
---|---|
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 ... |
void |
existingTableDetected(Connection connection,
Table table,
Model model,
Database database)
Called after an existing table has been detected in the database. |
String |
getAncestorsIdsSql()
Gets the SQL query to get the ancestors of a set of ids. |
String |
getCascadeDropConstraintsString()
|
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. |
String |
getFreeVariableSetterForType(ColumnType type)
Gets the JDBC expression setting a free value for this column type. |
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. |
String |
getMatchMixinType(Column mixinsColumn,
String mixin,
boolean positive,
String[] returnParam)
Gets the SQL fragment to match a mixin type. |
boolean |
getMaterializeFulltextSyntheticColumn()
Does the fulltext synthetic column have to be materialized. |
String |
getNoColumnsInsertString()
|
String |
getPagingClause(long limit,
long offset)
Gets paging clause to be appended at the end of select statement |
List<String> |
getPostCreateTableSqls(Table table,
Model model,
Database database)
Gets the sql statements to call after a table has been created. |
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 |
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 |
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. |
boolean |
isConnectionClosedException(Throwable t)
Checks if an exception received means that the low level connection has been trashed and must be reset. |
boolean |
needsAliasForDerivedTable()
Whether a derived table (subselect in a FROM statement) needs an alias. |
void |
performAdditionalStatements(Connection connection)
Let the dialect processes additional statements after tables creation and conditional statements. |
boolean |
preCreateTable(Connection connection,
Table table,
Model model,
Database database)
Called before a table is created, when it's been determined that it doesn't exist yet. |
void |
setToPreparedStatement(PreparedStatement ps,
int index,
Serializable value,
Column column)
|
boolean |
supportsAncestorsTable()
Checks if the dialect supports an ancestors table. |
boolean |
supportsArrays()
Does the dialect support passing ARRAY values (to stored procedures mostly). |
boolean |
supportsIlike()
Does the dialect support ILIKE operator |
boolean |
supportsPaging()
Indicates if dialect supports paging |
boolean |
supportsReadAcl()
Does the dialect support an optimized read security checks |
boolean |
supportsSysNameArray()
Checks if the dialect supports storing arrays of system names (for mixins for instance). |
boolean |
supportsUpdateFrom()
Does the dialect support UPDATE t SET ... |
boolean |
supportsWith()
Does the dialect support SQL-99 WITH common table expressions. |
String |
toBooleanValueString(boolean bool)
|
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public DialectPostgreSQL(DatabaseMetaData metadata, BinaryManager binaryManager, RepositoryDescriptor repositoryDescriptor) throws StorageException
StorageException
Method Detail |
---|
public String toBooleanValueString(boolean bool)
toBooleanValueString
in class Dialect
public String getNoColumnsInsertString()
getNoColumnsInsertString
in class Dialect
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
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 string
public 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 String getFreeVariableSetterForType(ColumnType type)
Dialect
Needed for columns that need an expression around the value being set,
usually for conversion (this is the case for PostgreSQL fulltext
TSVECTOR
columns for instance).
getFreeVariableSetterForType
in class Dialect
type
- the column type
public boolean supportsUpdateFrom()
Dialect
supportsUpdateFrom
in class Dialect
public boolean doesUpdateFromRepeatSelf()
Dialect
doesUpdateFromRepeatSelf
in class Dialect
public boolean needsAliasForDerivedTable()
Dialect
needsAliasForDerivedTable
in class Dialect
public boolean supportsIlike()
Dialect
supportsIlike
in class Dialect
public 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 use
public 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 use
public boolean supportsAncestorsTable()
Dialect
supportsAncestorsTable
in class Dialect
public String getInTreeSql(String idColumnName)
Dialect
getInTreeSql
in class Dialect
idColumnName
- the quoted name of the id column to use
public String getMatchMixinType(Column mixinsColumn, String mixin, boolean positive, String[] returnParam)
Dialect
getMatchMixinType
in class Dialect
public boolean supportsSysNameArray()
Dialect
supportsSysNameArray
in class Dialect
public boolean supportsArrays()
Dialect
If not, we'll simulate them using a string and a separator.
supportsArrays
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 connection
SQLException
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 preCreateTable(Connection connection, Table table, Model model, Database database) throws SQLException
Dialect
preCreateTable
in class Dialect
false
if the table must actually not be created
SQLException
public List<String> getPostCreateTableSqls(Table table, Model model, Database database)
Dialect
Used for migrations/upgrades.
getPostCreateTableSqls
in class Dialect
public void existingTableDetected(Connection connection, Table table, Model model, Database database) throws SQLException
Dialect
Used for migrations/upgrades.
existingTableDetected
in class Dialect
SQLException
public boolean isClusteringSupported()
Dialect
isClusteringSupported
in class Dialect
public String getClusterInsertInvalidations()
Dialect
getClusterInsertInvalidations
in class Dialect
public String getClusterGetInvalidations()
Dialect
getClusterGetInvalidations
in class Dialect
public boolean isConnectionClosedException(Throwable t)
Dialect
isConnectionClosedException
in class Dialect
public boolean supportsPaging()
Dialect
supportsPaging
in class Dialect
public String getPagingClause(long limit, long offset)
Dialect
getPagingClause
in class Dialect
public boolean supportsWith()
Dialect
supportsWith
in class Dialect
public void performAdditionalStatements(Connection connection) throws SQLException
Dialect
performAdditionalStatements
in class Dialect
SQLException
public String getUsersSeparator()
public String getValidationQuery()
Dialect
The query should throw an error if the connection is dead.
getValidationQuery
in class Dialect
public String getAncestorsIdsSql()
Dialect
getAncestorsIdsSql
in class Dialect
|
Nuxeo ECM Projects 5.4.3-SNAPSHOT | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |