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, java.util.Vector returnFields)
INTERNAL: Uses the returning clause on Postgres.
|
java.lang.String |
buildProcedureCallString(StoredProcedureCall call, org.eclipse.persistence.internal.sessions.AbstractSession session, org.eclipse.persistence.internal.sessions.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, org.eclipse.persistence.internal.databaseaccess.FieldTypeDefinition fieldType, boolean shouldPrintFieldIdentityClause) |
void |
printFieldUnique(java.io.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 <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, org.eclipse.persistence.internal.helper.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, getConstraintDeletionString, getCreateDatabaseSchemaString, getCreateViewString, getCreationInOutputProcedureToken, getCreationOutputProcedureToken, getCursorCode, getCustomModifyValueForCall, getDefaultSequenceTableName, 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, 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, setIsCastRequired, setMaxBatchWritingSize, setParameterValueInDatabaseCall, setPartitioningCallback, setPingSQL, setPrintInnerJoinInWhereClause, setPrintOuterJoinInWhereClause, setSequenceCounterFieldName, setSequenceNameFieldName, setSequenceTableName, setShouldBindAllParameters, setShouldBindLiterals, setShouldCacheAllStatements, setShouldCreateIndicesOnForeignKeys, setShouldForceFieldNamesToUpperCase, setShouldIgnoreCaseOnFieldComparisons, setShouldOptimizeDataConversion, setShouldTrimStrings, setShouldUseRownumFiltering, setStatementCacheSize, setStringBindingSize, setSupportsAutoCommit, setTableCreationSuffix, setTransactionIsolation, setUseJDBCStoredProcedureSyntax, setUsesBatchWriting, setUsesByteArrayBinding, setUsesJDBCBatchWriting, setUsesNativeBatchWriting, setUsesNativeSQL, setUsesStreamsForBinding, setUsesStringBinding, shouldAlwaysUseTempStorageForModifyAll, shouldBindAllParameters, shouldBindLiterals, shouldCacheAllStatements, shouldCreateIndicesForPrimaryKeys, shouldCreateIndicesOnForeignKeys, shouldCreateIndicesOnUniqueKeys, shouldForceFieldNamesToUpperCase, shouldIgnoreCaseOnFieldComparisons, shouldIgnoreException, shouldOptimizeDataConversion, shouldPrintConstraintNameAfter, shouldPrintFieldIdentityClause, shouldPrintInnerJoinInWhereClause, shouldPrintInOutputTokenBeforeType, shouldPrintInputTokenAtStart, shouldPrintLockingClauseAfterWhereClause, shouldPrintOuterJoinInWhereClause, shouldPrintOutputTokenBeforeType, shouldPrintStoredProcedureArgumentNameInCall, shouldPrintStoredProcedureVariablesAfterBeginString, shouldTrimStrings, shouldUseCustomModifyForCall, shouldUseRownumFiltering, supportsANSIInnerJoinSyntax, supportsAutoCommit, supportsAutoConversionToNumericForArithmeticOperations, 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, writeTableCreationSuffix
addSequence, 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, usesPlatformDefaultSequence
public int getJDBCType(java.lang.Class javaType)
getJDBCType
in class org.eclipse.persistence.internal.databaseaccess.DatabasePlatform
public int computeMaxRowsForSQL(int firstResultIndex, int maxResults)
computeMaxRowsForSQL
in class org.eclipse.persistence.internal.databaseaccess.DatabasePlatform
readQuery
-firstResultIndex
-maxResults
-MySQLPlatform
public static ExpressionOperator regexpOperator()
public ValueReadQuery getTimestampQuery()
getTimestampQuery
in interface org.eclipse.persistence.internal.databaseaccess.Platform
getTimestampQuery
in class org.eclipse.persistence.internal.databaseaccess.DatasourcePlatform
public java.lang.String getInOutputProcedureToken()
getInOutputProcedureToken
in class org.eclipse.persistence.internal.databaseaccess.DatabasePlatform
public boolean shouldPrintOutputTokenAtStart()
shouldPrintOutputTokenAtStart
in class org.eclipse.persistence.internal.databaseaccess.DatabasePlatform
public boolean isJDBCExecuteCompliant()
isJDBCExecuteCompliant
in class org.eclipse.persistence.internal.databaseaccess.DatabasePlatform
PostgreSQLPlatform
public boolean isPostgreSQL()
isPostgreSQL
in interface org.eclipse.persistence.internal.databaseaccess.Platform
isPostgreSQL
in class org.eclipse.persistence.internal.databaseaccess.DatasourcePlatform
public boolean shouldPrintAliasForUpdate()
shouldPrintAliasForUpdate
in class org.eclipse.persistence.internal.databaseaccess.DatabasePlatform
public boolean supportsIdentity()
supportsIdentity
in class org.eclipse.persistence.internal.databaseaccess.DatasourcePlatform
public ValueReadQuery buildSelectQueryForIdentity()
buildSelectQueryForIdentity
in class org.eclipse.persistence.internal.databaseaccess.DatasourcePlatform
public boolean supportsSequenceObjects()
supportsSequenceObjects
in class org.eclipse.persistence.internal.databaseaccess.DatasourcePlatform
public ValueReadQuery buildSelectQueryForSequenceObject(java.lang.String qualifiedSeqName, java.lang.Integer size)
buildSelectQueryForSequenceObject
in class org.eclipse.persistence.internal.databaseaccess.DatasourcePlatform
public void printFieldIdentityClause(java.io.Writer writer) throws ValidationException
printFieldIdentityClause
in class org.eclipse.persistence.internal.databaseaccess.DatabasePlatform
ValidationException
public boolean supportsLocalTempTables()
supportsLocalTempTables
in class org.eclipse.persistence.internal.databaseaccess.DatabasePlatform
public int getMaxFieldNameSize()
getMaxFieldNameSize
in class org.eclipse.persistence.internal.databaseaccess.DatabasePlatform
public java.lang.String getProcedureBeginString()
getProcedureBeginString
in class org.eclipse.persistence.internal.databaseaccess.DatabasePlatform
public java.lang.String getProcedureEndString()
getProcedureEndString
in class org.eclipse.persistence.internal.databaseaccess.DatabasePlatform
public java.lang.String buildProcedureCallString(StoredProcedureCall call, org.eclipse.persistence.internal.sessions.AbstractSession session, org.eclipse.persistence.internal.sessions.AbstractRecord row)
buildProcedureCallString
in class org.eclipse.persistence.internal.databaseaccess.DatabasePlatform
public java.lang.String getAssignmentString()
getAssignmentString
in class org.eclipse.persistence.internal.databaseaccess.DatabasePlatform
public java.lang.String getDropCascadeString()
getDropCascadeString
in class org.eclipse.persistence.internal.databaseaccess.DatabasePlatform
public void printFieldTypeSize(java.io.Writer writer, FieldDefinition field, org.eclipse.persistence.internal.databaseaccess.FieldTypeDefinition fieldType, boolean shouldPrintFieldIdentityClause) throws java.io.IOException
printFieldTypeSize
in class org.eclipse.persistence.internal.databaseaccess.DatabasePlatform
java.io.IOException
public void printFieldUnique(java.io.Writer writer, boolean shouldPrintFieldIdentityClause) throws java.io.IOException
printFieldUnique
in class org.eclipse.persistence.internal.databaseaccess.DatabasePlatform
java.io.IOException
public boolean shouldUseJDBCOuterJoinSyntax()
shouldUseJDBCOuterJoinSyntax
in class org.eclipse.persistence.internal.databaseaccess.DatabasePlatform
public boolean isAlterSequenceObjectSupported()
isAlterSequenceObjectSupported
in class org.eclipse.persistence.internal.databaseaccess.DatabasePlatform
public 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.DatabasePlatform
public void writeUpdateOriginalFromTempTableSql(java.io.Writer writer, org.eclipse.persistence.internal.helper.DatabaseTable table, java.util.Collection pkFields, java.util.Collection assignedFields) throws java.io.IOException
writeUpdateOriginalFromTempTableSql
in class org.eclipse.persistence.internal.databaseaccess.DatabasePlatform
java.io.IOException
public boolean canBuildCallWithReturning()
canBuildCallWithReturning
in class org.eclipse.persistence.internal.databaseaccess.DatabasePlatform
public org.eclipse.persistence.internal.databaseaccess.DatabaseCall buildCallWithReturning(SQLCall sqlCall, java.util.Vector returnFields)
buildCallWithReturning
in class org.eclipse.persistence.internal.databaseaccess.DatabasePlatform