public class PostgreSQLPlatform extends DatabasePlatform
Purpose: Provides Postgres specific behavior.
Responsibilities:
DEFAULT_VARCHAR_SIZEDEFAULT_MAX_BATCH_WRITING_SIZE, DEFAULT_PARAMETERIZED_MAX_BATCH_WRITING_SIZE, IS_VALID_TIMEOUT, shouldIgnoreCaseOnFieldComparisons, Types_NCLOB, Types_SQLXML| Constructor and Description |
|---|
PostgreSQLPlatform() |
| Modifier and Type | Method and Description |
|---|---|
DatabaseCall |
buildCallWithReturning(SQLCall sqlCall,
java.util.Vector returnFields)
INTERNAL:
Uses the returning clause on Postgres.
|
java.lang.String |
buildProcedureCallString(StoredProcedureCall call,
AbstractSession session,
AbstractRecord row)
INTERNAL: Used for sp calls.
|
ValueReadQuery |
buildSelectQueryForIdentity()
INTERNAL: Returns query used to read back the value generated by
Identity.
|
ValueReadQuery |
buildSelectQueryForSequenceObject(java.lang.String qualifiedSeqName,
java.lang.Integer size)
INTERNAL: Returns query used to read value generated by sequence object
(like Oracle sequence).
|
boolean |
canBuildCallWithReturning()
INTERNAL:
Postgres has a returning clause.
|
int |
computeMaxRowsForSQL(int firstResultIndex,
int maxResults)
INTERNAL: Use the JDBC maxResults and firstResultIndex setting to compute
a value to use when limiting the results of a query in SQL.
|
java.lang.String |
getAssignmentString()
INTERNAL Used for stored function calls.
|
java.lang.String |
getDropCascadeString()
Allows DROP TABLE to cascade dropping of any dependent constraints if the database supports this option.
|
java.lang.String |
getInOutputProcedureToken()
This method is used to print the output parameter token when stored
procedures are called
|
int |
getJDBCType(java.lang.Class javaType)
Return the JDBC type for the Java type.
|
int |
getMaxFieldNameSize()
INTERNAL: returns the maximum number of characters that can be used in a
field name on this platform.
|
java.lang.String |
getProcedureBeginString()
INTERNAL: Used for sp calls.
|
java.lang.String |
getProcedureEndString()
INTERNAL: Used for sp calls.
|
ValueReadQuery |
getTimestampQuery()
INTERNAL: This method returns the query to select the timestamp from the
server for Postgres.
|
boolean |
isAlterSequenceObjectSupported()
INTERNAL: Override this method if the platform supports sequence objects
and it's possible to alter sequence object's increment in the database.
|
boolean |
isJDBCExecuteCompliant()
Calling a stored procedure query on PostgreSQL with no output parameters
always returns true from an execute call regardless if a result set is
returned or not.
|
boolean |
isPostgreSQL()
INTERNAL: Answers whether platform is Postgres.
|
void |
printFieldIdentityClause(java.io.Writer writer)
INTERNAL: Append the receiver's field 'identity' constraint clause to a
writer.
|
void |
printFieldTypeSize(java.io.Writer writer,
FieldDefinition field,
FieldTypeDefinition fieldType,
boolean shouldPrintFieldIdentityClause) |
void |
printFieldUnique(java.io.Writer writer,
boolean shouldPrintFieldIdentityClause) |
void |
printSQLSelectStatement(DatabaseCall call,
ExpressionSQLPrinter printer,
SQLSelectStatement statement)
Print the pagination SQL using Postgres syntax
" LIMIT <max> OFFSET <first>".
|
static ExpressionOperator |
regexpOperator()
INTERNAL:
Create the ~ operator.
|
boolean |
shouldPrintAliasForUpdate()
INTERNAL: Indicates whether locking OF clause should print alias for
field.
|
boolean |
shouldPrintOutputTokenAtStart()
This is required in the construction of the stored procedures with output
parameters
|
boolean |
shouldUseJDBCOuterJoinSyntax()
JDBC defines and outer join syntax, many drivers do not support this.
|
boolean |
supportsIdentity()
INTERNAL: Indicates whether the platform supports identity.
|
boolean |
supportsLocalTempTables()
INTERNAL:
|
boolean |
supportsSequenceObjects()
INTERNAL: Indicates whether the platform supports sequence objects.
|
void |
writeUpdateOriginalFromTempTableSql(java.io.Writer writer,
DatabaseTable table,
java.util.Collection pkFields,
java.util.Collection assignedFields)
INTERNAL: May need to override this method if the platform supports
temporary tables and the generated sql doesn't work.
|
addBatch, addStructConverter, allowsSizeInProcedureArguments, appendLiteralToCall, appendParameter, appendParameterInternal, autoCommit, beginTransaction, buildBatchCriteria, buildBatchCriteriaForComplexId, buildCreateIndex, buildCreateIndex, buildDropIndex, buildDropIndex, buildSequenceObjectAlterIncrementWriter, buildSequenceObjectCreationWriter, buildSequenceObjectDeletionWriter, canBatchWriteWithOptimisticLocking, commitTransaction, convertToDatabaseType, copyInto, createArray, createArray, createStruct, createStruct, dontBindUpdateAllQueryUsingTempTables, executeBatch, executeStoredProcedure, freeTemporaryObject, getBatchBeginString, getBatchDelimiterString, getBatchEndString, getBatchRowCountAssignString, getBatchRowCountDeclareString, getBatchRowCountReturnString, getBatchWritingMechanism, getCastSizeForVarcharParameter, getClassTypes, getConnection, getConnectionUserName, getConstraintDeletionString, getCreateDatabaseSchemaString, getCreateViewString, getCreationInOutputProcedureToken, getCreationOutputProcedureToken, getCursorCode, getCustomModifyValueForCall, getDefaultSequenceTableName, getDriverSupportsNVarChar, getDropDatabaseSchemaString, getFieldTypeDefinition, getFieldTypes, getFunctionCallHeader, getIdentifierQuoteCharacter, getIndexNamePrefix, getInputProcedureToken, getJDBCOuterJoinString, getJDBCType, getJDBCTypeForSetNull, getJdbcTypeName, getMaxBatchWritingSize, getMaxForeignKeyNameSize, getMaxIndexNameSize, getMaxUniqueKeyNameSize, getNoWaitString, getObjectFromResultSet, getOutputProcedureToken, getPartitioningCallback, getPingSQL, getProcedureArgumentSetter, getProcedureArgumentString, getProcedureAsString, getProcedureCallHeader, getProcedureCallTail, getQualifiedName, getQualifiedSequenceTableName, getRefValue, getRefValue, getSelectForUpdateNoWaitString, getSelectForUpdateOfString, getSelectForUpdateString, getSelectForUpdateWaitString, getSequenceCounterFieldName, getSequenceNameFieldName, getSequencePreallocationSize, getSequenceTableName, getStatementCacheSize, getStoredProcedureParameterPrefix, getStoredProcedureTerminationToken, getStringBindingSize, getStructConverters, getTableCreationSuffix, getTempTableForTable, getTransactionIsolation, getTypeConverters, getUniqueConstraintDeletionString, getUseNationalCharacterVaryingTypeForString, getVPDClearIdentifierQuery, getVPDCreationFunctionString, getVPDCreationPolicyString, getVPDDeletionString, getVPDSetIdentifierQuery, hasPartitioningCallback, initialize, initializeConnectionData, isCastRequired, isDynamicSQLRequiredForFunctions, isForUpdateCompatibleWithDistinct, isInformixOuterJoin, isLobCompatibleWithDistinct, isLockTimeoutException, isNullAllowedInSelectClause, isOutputAllowWithResultSet, isRowCountOutputParameterRequired, isXDBDocument, maximumNumericValues, minimumNumericValues, minimumTimeIncrement, prepareBatchStatement, printFieldNotNullClause, printFieldNullClause, printStoredFunctionReturnKeyWord, printValuelist, printValuelist, registerOutputParameter, requiresNamedPrimaryKeyConstraints, requiresProcedureBrackets, requiresProcedureCallBrackets, requiresProcedureCallOuputToken, requiresTableInIndexDropDDL, requiresTypeNameToRegisterOutputParameter, requiresUniqueConstraintCreationOnTableCreate, retrieveFirstPrimaryKeyOrOne, rollbackTransaction, setBatchWritingMechanism, setCastSizeForVarcharParameter, setCursorCode, setDriverName, setDriverSupportsNVarChar, setIsCastRequired, setMaxBatchWritingSize, setParameterValueInDatabaseCall, setPartitioningCallback, setPingSQL, setPrintInnerJoinInWhereClause, setPrintOuterJoinInWhereClause, setSequenceCounterFieldName, setSequenceNameFieldName, setSequenceTableName, setShouldBindAllParameters, setShouldBindLiterals, setShouldCacheAllStatements, setShouldCreateIndicesOnForeignKeys, setShouldForceFieldNamesToUpperCase, setShouldIgnoreCaseOnFieldComparisons, setShouldOptimizeDataConversion, setShouldTrimStrings, setShouldUseRownumFiltering, setStatementCacheSize, setStoredProcedureTerminationToken, setStringBindingSize, setSupportsAutoCommit, setTableCreationSuffix, setTransactionIsolation, setUseJDBCStoredProcedureSyntax, setUseNationalCharacterVaryingTypeForString, setUsesBatchWriting, setUsesByteArrayBinding, setUsesJDBCBatchWriting, setUsesNativeBatchWriting, setUsesNativeSQL, setUsesStreamsForBinding, setUsesStringBinding, shouldAlwaysUseTempStorageForModifyAll, shouldBindAllParameters, shouldBindLiterals, shouldCacheAllStatements, shouldCreateIndicesForPrimaryKeys, shouldCreateIndicesOnForeignKeys, shouldCreateIndicesOnUniqueKeys, shouldForceFieldNamesToUpperCase, shouldIgnoreCaseOnFieldComparisons, shouldIgnoreException, shouldOptimizeDataConversion, shouldPrintConstraintNameAfter, shouldPrintFieldIdentityClause, shouldPrintForUpdateClause, shouldPrintInnerJoinInWhereClause, shouldPrintInOutputTokenBeforeType, shouldPrintInputTokenAtStart, shouldPrintLockingClauseAfterWhereClause, shouldPrintOuterJoinInWhereClause, shouldPrintOutputTokenBeforeType, shouldPrintStoredProcedureArgumentNameInCall, shouldPrintStoredProcedureVariablesAfterBeginString, shouldTrimStrings, shouldUseCustomModifyForCall, shouldUseGetSetNString, shouldUseRownumFiltering, supportsANSIInnerJoinSyntax, supportsAutoCommit, supportsAutoConversionToNumericForArithmeticOperations, supportsConnectionUserName, supportsCountDistinctWithMultipleFields, supportsDeleteOnCascade, supportsForeignKeyConstraints, supportsGlobalTempTables, supportsIndexes, supportsIndividualTableLocking, supportsLockingQueriesWithMultipleTables, supportsNestingOuterJoins, supportsOuterJoinsWithBrackets, supportsPrimaryKeyConstraint, supportsStoredFunctions, supportsTempTables, supportsUniqueColumns, supportsUniqueKeyConstraints, supportsVPD, usesBatchWriting, usesByteArrayBinding, usesJDBCBatchWriting, usesNativeBatchWriting, usesNativeSQL, usesSequenceTable, usesStreamsForBinding, usesStringBinding, wasFailureCommunicationBased, writeAddColumnClause, writeCleanUpTempTableSql, writeCreateTempTableSql, writeDeleteFromTargetTableUsingTempTableSql, writeInsertIntoTableSql, writeLOB, writeParameterMarker, writeTableCreationSuffixaddSequence, addSequence, buildNativeCall, buildSelectQueryForIdentity, buildSelectQueryForSequenceObject, clone, convertObject, createConnectionCustomizer, getConversionManager, getDataTypesConvertedFrom, getDataTypesConvertedTo, getDefaultNativeSequenceToTable, getDefaultSequence, getDefaultSequenceToWrite, getEndDelimiter, getOperator, getPlatformOperators, getSelectSequenceQuery, getSequence, getSequences, getSequencesToWrite, getStartDelimiter, getTableQualifier, getTimestampFromServer, getUpdateSequenceQuery, hasDefaultSequence, initializeDefaultQueries, isAccess, isAttunity, isCloudscape, isDB2, isDBase, isDerby, isFirebird, isH2, isHANA, isHSQL, isInformix, isMaxDB, isMySQL, isODBC, isOracle, isOracle9, isPervasive, isPointBase, isSQLAnywhere, isSQLServer, isSybase, isSymfoware, isTimesTen, isTimesTen7, removeAllSequences, removeSequence, setConversionManager, setDefaultNativeSequenceToTable, setDefaultSequence, setEndDelimiter, setSelectSequenceNumberQuery, setSequencePreallocationSize, setSequences, setStartDelimiter, setTableQualifier, setTimestampQuery, setUpdateSequenceQuery, shouldNativeSequenceUseTransaction, shouldPrepare, shouldSelectDistinctIncludeOrderBy, shouldSelectIncludeOrderBy, supportsNativeSequenceNumbers, toString, usesPlatformDefaultSequencepublic int getJDBCType(java.lang.Class javaType)
getJDBCType in class DatabasePlatformpublic int computeMaxRowsForSQL(int firstResultIndex,
int maxResults)
computeMaxRowsForSQL in class DatabasePlatformfirstResultIndex - maxResults - MySQLPlatformpublic static ExpressionOperator regexpOperator()
public ValueReadQuery getTimestampQuery()
getTimestampQuery in interface PlatformgetTimestampQuery in class DatasourcePlatformpublic java.lang.String getInOutputProcedureToken()
getInOutputProcedureToken in class DatabasePlatformpublic boolean shouldPrintOutputTokenAtStart()
shouldPrintOutputTokenAtStart in class DatabasePlatformpublic boolean isJDBCExecuteCompliant()
isJDBCExecuteCompliant in class DatabasePlatformPostgreSQLPlatformpublic boolean isPostgreSQL()
isPostgreSQL in interface PlatformisPostgreSQL in class DatasourcePlatformpublic boolean shouldPrintAliasForUpdate()
shouldPrintAliasForUpdate in class DatabasePlatformpublic boolean supportsIdentity()
supportsIdentity in class DatasourcePlatformpublic ValueReadQuery buildSelectQueryForIdentity()
buildSelectQueryForIdentity in class DatasourcePlatformpublic boolean supportsSequenceObjects()
supportsSequenceObjects in class DatasourcePlatformpublic ValueReadQuery buildSelectQueryForSequenceObject(java.lang.String qualifiedSeqName, java.lang.Integer size)
buildSelectQueryForSequenceObject in class DatasourcePlatformpublic void printFieldIdentityClause(java.io.Writer writer)
throws ValidationException
printFieldIdentityClause in class DatabasePlatformValidationExceptionpublic boolean supportsLocalTempTables()
supportsLocalTempTables in class DatabasePlatformpublic int getMaxFieldNameSize()
getMaxFieldNameSize in class DatabasePlatformpublic java.lang.String getProcedureBeginString()
getProcedureBeginString in class DatabasePlatformpublic java.lang.String getProcedureEndString()
getProcedureEndString in class DatabasePlatformpublic java.lang.String buildProcedureCallString(StoredProcedureCall call, AbstractSession session, AbstractRecord row)
buildProcedureCallString in class DatabasePlatformpublic java.lang.String getAssignmentString()
getAssignmentString in class DatabasePlatformpublic java.lang.String getDropCascadeString()
getDropCascadeString in class DatabasePlatformpublic void printFieldTypeSize(java.io.Writer writer,
FieldDefinition field,
FieldTypeDefinition fieldType,
boolean shouldPrintFieldIdentityClause)
throws java.io.IOException
printFieldTypeSize in class DatabasePlatformjava.io.IOExceptionpublic void printFieldUnique(java.io.Writer writer,
boolean shouldPrintFieldIdentityClause)
throws java.io.IOException
printFieldUnique in class DatabasePlatformjava.io.IOExceptionpublic boolean shouldUseJDBCOuterJoinSyntax()
shouldUseJDBCOuterJoinSyntax in class DatabasePlatformpublic boolean isAlterSequenceObjectSupported()
isAlterSequenceObjectSupported in class DatabasePlatformpublic void printSQLSelectStatement(DatabaseCall call, ExpressionSQLPrinter printer, SQLSelectStatement statement)
printSQLSelectStatement in class DatabasePlatformpublic void writeUpdateOriginalFromTempTableSql(java.io.Writer writer,
DatabaseTable table,
java.util.Collection pkFields,
java.util.Collection assignedFields)
throws java.io.IOException
writeUpdateOriginalFromTempTableSql in class DatabasePlatformwriter - for writing the sqltable - is original table for which temp table is
created.pkFields - - primary key fields for the original
table.assignedFields - - fields to be assigned a new value.java.io.IOExceptionpublic boolean canBuildCallWithReturning()
canBuildCallWithReturning in class DatabasePlatformpublic DatabaseCall buildCallWithReturning(SQLCall sqlCall, java.util.Vector returnFields)
buildCallWithReturning in class DatabasePlatformEclipseLink 2.6.3, "build v20160428-59c81c5" API Reference