public class PostgreSQLPlatform extends DatabasePlatform
Purpose: Provides Postgres specific behavior.
Responsibilities:
DEFAULT_VARCHAR_SIZE| Constructor and Description |
|---|
PostgreSQLPlatform() |
| Modifier and Type | Method and Description |
|---|---|
org.eclipse.persistence.internal.databaseaccess.DatabaseCall |
buildCallWithReturning(SQLCall sqlCall,
Vector returnFields)
INTERNAL:
Uses the returning clause on Postgres.
|
ValueReadQuery |
buildSelectQueryForIdentity()
INTERNAL: Returns query used to read back the value generated by
Identity.
|
ValueReadQuery |
buildSelectQueryForSequenceObject(String qualifiedSeqName,
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.
|
String |
getAssignmentString()
INTERNAL Used for stored function calls.
|
String |
getInOutputProcedureToken()
This method is used to print the output parameter token when stored
procedures are called
|
int |
getJDBCType(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.
|
String |
getProcedureBeginString()
INTERNAL: Used for sp calls.
|
String |
getProcedureCallHeader()
INTERNAL: Used for sp calls.
|
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 |
isPostgreSQL()
INTERNAL: Answers whether platform is Postgres.
|
void |
printFieldIdentityClause(Writer writer)
INTERNAL: Append the receiver's field 'identity' constraint clause to a
writer.
|
void |
printFieldTypeSize(Writer writer,
FieldDefinition field,
org.eclipse.persistence.internal.databaseaccess.FieldTypeDefinition fieldType,
boolean shouldPrintFieldIdentityClause) |
void |
printFieldUnique(Writer writer,
boolean shouldPrintFieldIdentityClause) |
void |
printSQLSelectStatement(org.eclipse.persistence.internal.databaseaccess.DatabaseCall call,
org.eclipse.persistence.internal.expressions.ExpressionSQLPrinter printer,
org.eclipse.persistence.internal.expressions.SQLSelectStatement statement)
Print the pagination SQL using Postgres syntax
" LIMIT
|
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(Writer writer,
org.eclipse.persistence.internal.helper.DatabaseTable table,
Collection pkFields,
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, buildCreateIndex, buildDropIndex, buildProcedureCallString, buildSelectQueryForIdentity, buildSelectQueryForSequenceObject, buildSequenceObjectAlterIncrementWriter, buildSequenceObjectCreationWriter, buildSequenceObjectDeletionWriter, canBatchWriteWithOptimisticLocking, commitTransaction, convertToDatabaseType, copyInto, createArray, createArray, createStruct, createStruct, dontBindUpdateAllQueryUsingTempTables, executeBatch, executeStoredProcedure, freeTemporaryObject, getBatchBeginString, getBatchDelimiterString, getBatchEndString, getCastSizeForVarcharParameter, getClassTypes, getConnection, getConstraintDeletionString, getCreateViewString, getCreationInOutputProcedureToken, getCreationOutputProcedureToken, getCursorCode, getCustomModifyValueForCall, getDefaultSequenceTableName, getFieldTypeDefinition, getFieldTypes, getFunctionCallHeader, getIdentifierQuoteCharacter, getInputProcedureToken, getJDBCOuterJoinString, getJDBCType, getJdbcTypeName, getMaxBatchWritingSize, getMaxForeignKeyNameSize, getMaxIndexNameSize, getMaxUniqueKeyNameSize, getNoWaitString, getObjectFromResultSet, getOutputProcedureToken, getPingSQL, getProcedureArgumentSetter, getProcedureArgumentString, getProcedureAsString, getProcedureCallTail, getQualifiedName, getQualifiedSequenceTableName, getRefValue, getRefValue, getSelectForUpdateNoWaitString, getSelectForUpdateOfString, getSelectForUpdateString, getSelectForUpdateWaitString, getSequenceCounterFieldName, getSequenceNameFieldName, getSequencePreallocationSize, getSequenceTableName, getStatementCacheSize, getStoredProcedureParameterPrefix, getStoredProcedureTerminationToken, getStringBindingSize, getStructConverters, getTempTableForTable, getTransactionIsolation, getTypeConverters, initialize, isCastRequired, isDynamicSQLRequiredForFunctions, isForUpdateCompatibleWithDistinct, isInformixOuterJoin, isLockTimeoutException, isNullAllowedInSelectClause, isXDBDocument, maximumNumericValues, minimumNumericValues, prepareBatchStatement, printFieldNotNullClause, printFieldNullClause, printStoredFunctionReturnKeyWord, printValuelist, printValuelist, registerOutputParameter, requiresNamedPrimaryKeyConstraints, requiresProcedureBrackets, requiresProcedureCallBrackets, requiresProcedureCallOuputToken, requiresTypeNameToRegisterOutputParameter, requiresUniqueConstraintCreationOnTableCreate, retrieveFirstPrimaryKeyOrOne, rollbackTransaction, setCastSizeForVarcharParameter, setCursorCode, setIsCastRequired, setMaxBatchWritingSize, setParameterValueInDatabaseCall, setPingSQL, setPrintOuterJoinInWhereClause, setSequenceCounterFieldName, setSequenceNameFieldName, setSequenceTableName, setShouldBindAllParameters, setShouldBindLiterals, setShouldCacheAllStatements, setShouldForceFieldNamesToUpperCase, setShouldIgnoreCaseOnFieldComparisons, setShouldOptimizeDataConversion, setShouldTrimStrings, setShouldUseRownumFiltering, setStatementCacheSize, setStringBindingSize, setSupportsAutoCommit, setTransactionIsolation, setUsesBatchWriting, setUsesByteArrayBinding, setUsesJDBCBatchWriting, setUsesNativeBatchWriting, setUsesNativeSQL, setUsesStreamsForBinding, setUsesStringBinding, shouldAlwaysUseTempStorageForModifyAll, shouldBindAllParameters, shouldBindLiterals, shouldCacheAllStatements, shouldCreateIndicesForPrimaryKeys, shouldCreateIndicesOnUniqueKeys, shouldForceFieldNamesToUpperCase, shouldIgnoreCaseOnFieldComparisons, shouldIgnoreException, shouldNativeSequenceUseTransaction, shouldOptimizeDataConversion, shouldPrintConstraintNameAfter, shouldPrintFieldIdentityClause, shouldPrintInOutputTokenBeforeType, shouldPrintInputTokenAtStart, shouldPrintLockingClauseAfterWhereClause, shouldPrintOuterJoinInWhereClause, shouldPrintOutputTokenBeforeType, shouldPrintStoredProcedureArgumentNameInCall, shouldPrintStoredProcedureVariablesAfterBeginString, shouldTrimStrings, shouldUseCustomModifyForCall, shouldUseRownumFiltering, supportsANSIInnerJoinSyntax, supportsAutoCommit, supportsAutoConversionToNumericForArithmeticOperations, supportsForeignKeyConstraints, supportsGlobalTempTables, supportsIndividualTableLocking, supportsLockingQueriesWithMultipleTables, supportsNativeSequenceNumbers, supportsNestingOuterJoins, supportsOuterJoinsWithBrackets, supportsPrimaryKeyConstraint, supportsStoredFunctions, supportsTempTables, supportsUniqueColumns, supportsUniqueKeyConstraints, usesBatchWriting, usesByteArrayBinding, usesJDBCBatchWriting, usesNativeBatchWriting, usesNativeSQL, usesSequenceTable, usesStreamsForBinding, usesStringBinding, wasFailureCommunicationBased, writeCleanUpTempTableSql, writeCreateTempTableSql, writeDeleteFromTargetTableUsingTempTableSql, writeInsertIntoTableSql, writeLOB, writeParameterMarkeraddSequence, clone, convertObject, createConnectionCustomizer, getConversionManager, getDataTypesConvertedFrom, getDataTypesConvertedTo, getDefaultSequence, getDefaultSequenceToWrite, getEndDelimiter, getOperator, getPlatformOperators, getSelectSequenceQuery, getSequence, getSequences, getSequencesToWrite, getStartDelimiter, getTableQualifier, getTimestampFromServer, getUpdateSequenceQuery, hasDefaultSequence, isAccess, isAttunity, isCloudscape, isDB2, isDBase, isDerby, isFirebird, isH2, isHSQL, isInformix, isMySQL, isODBC, isOracle, isOracle9, isPointBase, isSQLAnywhere, isSQLServer, isSybase, isSymfoware, isTimesTen, isTimesTen7, removeAllSequences, removeSequence, setConversionManager, setDefaultSequence, setEndDelimiter, setSelectSequenceNumberQuery, setSequencePreallocationSize, setSequences, setStartDelimiter, setTableQualifier, setTimestampQuery, setUpdateSequenceQuery, toString, usesPlatformDefaultSequencepublic int getJDBCType(Class javaType)
getJDBCType in class org.eclipse.persistence.internal.databaseaccess.DatabasePlatformpublic int computeMaxRowsForSQL(int firstResultIndex,
int maxResults)
computeMaxRowsForSQL in class org.eclipse.persistence.internal.databaseaccess.DatabasePlatformreadQuery - firstResultIndex - maxResults - MySQLPlatformpublic ValueReadQuery getTimestampQuery()
getTimestampQuery in interface org.eclipse.persistence.internal.databaseaccess.PlatformgetTimestampQuery in class org.eclipse.persistence.internal.databaseaccess.DatasourcePlatformpublic String getInOutputProcedureToken()
getInOutputProcedureToken in class org.eclipse.persistence.internal.databaseaccess.DatabasePlatformpublic boolean shouldPrintOutputTokenAtStart()
shouldPrintOutputTokenAtStart in class org.eclipse.persistence.internal.databaseaccess.DatabasePlatformpublic boolean isPostgreSQL()
isPostgreSQL in interface org.eclipse.persistence.internal.databaseaccess.PlatformisPostgreSQL in class org.eclipse.persistence.internal.databaseaccess.DatasourcePlatformpublic boolean shouldPrintAliasForUpdate()
shouldPrintAliasForUpdate in class org.eclipse.persistence.internal.databaseaccess.DatabasePlatformpublic boolean supportsIdentity()
supportsIdentity in class org.eclipse.persistence.internal.databaseaccess.DatabasePlatformpublic ValueReadQuery buildSelectQueryForIdentity()
buildSelectQueryForIdentity in class org.eclipse.persistence.internal.databaseaccess.DatabasePlatformpublic boolean supportsSequenceObjects()
supportsSequenceObjects in class org.eclipse.persistence.internal.databaseaccess.DatabasePlatformpublic ValueReadQuery buildSelectQueryForSequenceObject(String qualifiedSeqName, Integer size)
buildSelectQueryForSequenceObject in class org.eclipse.persistence.internal.databaseaccess.DatabasePlatformpublic void printFieldIdentityClause(Writer writer) throws ValidationException
printFieldIdentityClause in class org.eclipse.persistence.internal.databaseaccess.DatabasePlatformValidationExceptionpublic boolean supportsLocalTempTables()
supportsLocalTempTables in class org.eclipse.persistence.internal.databaseaccess.DatabasePlatformpublic int getMaxFieldNameSize()
getMaxFieldNameSize in class org.eclipse.persistence.internal.databaseaccess.DatabasePlatformpublic String getProcedureBeginString()
getProcedureBeginString in class org.eclipse.persistence.internal.databaseaccess.DatabasePlatformpublic String getProcedureEndString()
getProcedureEndString in class org.eclipse.persistence.internal.databaseaccess.DatabasePlatformpublic String getProcedureCallHeader()
getProcedureCallHeader in class org.eclipse.persistence.internal.databaseaccess.DatabasePlatformpublic String getAssignmentString()
getAssignmentString in class org.eclipse.persistence.internal.databaseaccess.DatabasePlatformpublic void printFieldTypeSize(Writer writer, FieldDefinition field, org.eclipse.persistence.internal.databaseaccess.FieldTypeDefinition fieldType, boolean shouldPrintFieldIdentityClause) throws IOException
printFieldTypeSize in class org.eclipse.persistence.internal.databaseaccess.DatabasePlatformIOExceptionpublic void printFieldUnique(Writer writer, boolean shouldPrintFieldIdentityClause) throws IOException
printFieldUnique in class org.eclipse.persistence.internal.databaseaccess.DatabasePlatformIOExceptionpublic boolean shouldUseJDBCOuterJoinSyntax()
shouldUseJDBCOuterJoinSyntax in class org.eclipse.persistence.internal.databaseaccess.DatabasePlatformpublic boolean isAlterSequenceObjectSupported()
isAlterSequenceObjectSupported in class org.eclipse.persistence.internal.databaseaccess.DatabasePlatformpublic void printSQLSelectStatement(org.eclipse.persistence.internal.databaseaccess.DatabaseCall call,
org.eclipse.persistence.internal.expressions.ExpressionSQLPrinter printer,
org.eclipse.persistence.internal.expressions.SQLSelectStatement statement)
printSQLSelectStatement in class org.eclipse.persistence.internal.databaseaccess.DatabasePlatformpublic void writeUpdateOriginalFromTempTableSql(Writer writer, org.eclipse.persistence.internal.helper.DatabaseTable table, Collection pkFields, Collection assignedFields) throws IOException
writeUpdateOriginalFromTempTableSql in class org.eclipse.persistence.internal.databaseaccess.DatabasePlatformIOExceptionpublic boolean canBuildCallWithReturning()
canBuildCallWithReturning in class org.eclipse.persistence.internal.databaseaccess.DatabasePlatformpublic org.eclipse.persistence.internal.databaseaccess.DatabaseCall buildCallWithReturning(SQLCall sqlCall, Vector returnFields)
buildCallWithReturning in class org.eclipse.persistence.internal.databaseaccess.DatabasePlatform