public class PostgreSQLPlatform extends DatabasePlatform
Purpose: Provides Postgres specific behaviour.
Responsibilities:
classTypes, cursorCode, fieldTypes, shouldBindAllParameters, shouldCacheAllStatements, shouldForceFieldNamesToUpperCase, shouldIgnoreCaseOnFieldComparisons, shouldOptimizeDataConversion, shouldTrimStrings, statementCacheSize, stringBindingSize, supportsAutoCommit, transactionIsolation, usesByteArrayBinding, usesNativeSQL, usesStreamsForBinding, usesStringBindingconversionManager, dataTypesConvertedFromAClass, dataTypesConvertedToAClass, defaultSequence, platformOperators, sequences, tableQualifier, timestampQuery| Constructor and Description |
|---|
PostgreSQLPlatform() |
| Modifier and Type | Method and Description |
|---|---|
protected void |
appendBoolean(Boolean bool,
Writer writer)
Appends a Boolean value.
|
protected Hashtable |
buildFieldTypes()
Return the mapping of class types to database types for the schema framework.
|
ValueReadQuery |
buildSelectQueryForNativeSequence(String seqName,
Integer size)
INTERNAL:
Build the identity query for native sequencing.
|
String |
getAssignmentString()
INTERNAL
Used for stored function calls.
|
protected String |
getCreateTempTableSqlBodyForTable(DatabaseTable table)
INTERNAL:
|
protected String |
getCreateTempTableSqlPrefix()
INTERNAL:
|
protected String |
getCreateTempTableSqlSuffix()
INTERNAL:
|
protected String |
getDBSequenceName(String tableName,
String pkFieldName) |
String |
getInOutputProcedureToken()
This method is used to print the output parameter token when stored
procedures are called
|
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 Derby.
|
protected void |
initializePlatformOperators()
INTERNAL:
Initialize any platform-specific operators
|
boolean |
isPostgreSQL()
INTERNAL:
Answers whether platform is Derby
|
protected ExpressionOperator |
operatorLocate()
INTERNAL:
Override the default locate operator
|
void |
platformSpecificSequencingInitialization(DatabaseSession session)
INTERNAL:
Platform specific sequencing initialization.
|
void |
printFieldIdentityClause(Writer writer)
INTERNAL:
Append the receiver's field 'identity' constraint clause to a writer
|
void |
printFieldTypeSize(Writer writer,
FieldDefinition field,
FieldTypeDefinition fieldType,
AbstractSession session,
String qualifiedFieldName) |
void |
printFieldUnique(Writer writer,
boolean isUnique,
AbstractSession session,
String qualifiedFieldName) |
protected void |
setPrimitiveParameterValue(PreparedStatement statement,
int index,
Object parameter)
Set a primitive parameter.
|
boolean |
shouldNativeSequenceAcquireValueAfterInsert()
INTERNAL:
Indicates whether NativeSequence should retrieve
sequence value after the object has been inserted into the db
This method is to be used *ONLY* by sequencing classes
|
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 |
supportsGlobalTempTables()
INTERNAL:
|
boolean |
supportsNativeSequenceNumbers() |
allowsSizeInProcedureArguments, appendByteArray, appendCalendar, appendDate, appendLiteralToCall, appendLiteralToCallWithBinding, appendNumber, appendParameter, appendParameterInternal, appendString, appendTime, appendTimestamp, autoCommit, beginTransaction, buildCallWithReturning, buildClassTypes, buildSelectQueryForNativeSequence, canBuildCallWithReturning, commitTransaction, convertToDatabaseType, copyInto, createPlatformDefaultSequence, dontBindUpdateAllQueryUsingTempTables, executeStoredProcedure, getBatchBeginString, getBatchDelimiterString, getBatchEndString, getClassTypes, getConstraintDeletionString, getCreateViewString, getCreationInOutputProcedureToken, getCreationOutputProcedureToken, getCursorCode, getFieldTypeDefinition, getFieldTypes, getFunctionCallHeader, getJDBCOuterJoinString, getJDBCType, getJDBCType, getJdbcTypeName, getMaxForeignKeyNameSize, getMaxUniqueKeyNameSize, getObjectFromResultSet, getOutputProcedureToken, getProcedureArgumentSetter, getProcedureArgumentString, getProcedureAsString, getProcedureCallTail, getQualifiedSequenceTableName, getSelectForUpdateNoWaitString, getSelectForUpdateOfString, getSelectForUpdateString, getSequenceCounterFieldName, getSequenceNameFieldName, getSequencePreallocationSize, getSequenceTableName, getStatementCacheSize, getStoredProcedureParameterPrefix, getStoredProcedureTerminationToken, getStringBindingSize, getTempTableForTable, getTransactionIsolation, isInformixOuterJoin, isNullAllowedInSelectClause, maximumNumericValues, minimumNumericValues, printFieldIdentityClause, printFieldNotNullClause, printFieldNullClause, printValuelist, printValuelist, processResultSet, registerOutputParameter, requiresNamedPrimaryKeyConstraints, requiresProcedureCallBrackets, requiresProcedureCallOuputToken, requiresTypeNameToRegisterOutputParameter, rollbackTransaction, setClassTypes, setCursorCode, setFieldTypes, setParameterValueInDatabaseCall, setParameterValueInDatabaseCall, setParameterValueInDatabaseCall, setSequenceCounterFieldName, setSequenceNameFieldName, setSequenceTableName, setShouldBindAllParameters, setShouldCacheAllStatements, setShouldForceFieldNamesToUpperCase, setShouldIgnoreCaseOnFieldComparisons, setShouldOptimizeDataConversion, setShouldTrimStrings, setStatementCacheSize, setStringBindingSize, setSupportsAutoCommit, setTransactionIsolation, setUsesByteArrayBinding, setUsesNativeSQL, setUsesStreamsForBinding, setUsesStringBinding, shouldAcquireSequenceValueAfterInsert, shouldAlwaysUseTempStorageForModifyAll, shouldBindAllParameters, shouldBindLiterals, shouldCacheAllStatements, shouldForceFieldNamesToUpperCase, shouldIgnoreCaseOnFieldComparisons, shouldIgnoreException, shouldNativeSequenceUseTransaction, shouldOptimizeDataConversion, shouldPrintConstraintNameAfter, shouldPrintInOutputTokenBeforeType, shouldPrintOuterJoinInWhereClause, shouldPrintOutputTokenBeforeType, shouldTempTableSpecifyPrimaryKeys, shouldTrimStrings, supportsAutoCommit, supportsForeignKeyConstraints, supportsLocalTempTables, supportsPrimaryKeyConstraint, supportsStoredFunctions, supportsTempTables, supportsUniqueKeyConstraints, usesByteArrayBinding, usesNativeSQL, usesSequenceTable, usesStreamsForBinding, usesStringBinding, writeAutoAssignmentSetClause, writeAutoJoinWhereClause, writeCleanUpTempTableSql, writeCreateTempTableSql, writeDeleteFromTargetTableUsingTempTableSql, writeFields, writeFieldsAutoClause, writeFieldsList, writeInsertIntoTableSql, writeJoinWhereClause, writeLOB, writeParameterMarker, writeUpdateOriginalFromTempTableSqladdOperator, addSequence, clone, convertObject, createSequences, getConversionManager, getCustomModifyValueForCall, getDataTypesConvertedFrom, getDataTypesConvertedTo, getDefaultSequence, getDefaultSequenceToWrite, getOperator, getPlatformOperators, getSequence, getSequences, getSequencesToWrite, getTableQualifier, getTimestampFromServer, hasDefaultSequence, isAccess, isAttunity, isCloudscape, isDB2, isDBase, isDerby, isHSQL, isInformix, isMySQL, isODBC, isOracle, isPointBase, isSQLAnywhere, isSQLServer, isSybase, isTimesTen, removeAllSequences, removeSequence, sequencesAfterCloneCleanup, setConversionManager, setDefaultSequence, setSequences, setTableQualifier, setTimestampQuery, shouldUseCustomModifyForCall, toString, usesPlatformDefaultSequenceprotected void appendBoolean(Boolean bool, Writer writer) throws IOException
appendBoolean in class DatabasePlatformIOExceptionprotected void initializePlatformOperators()
initializePlatformOperators in class DatasourcePlatformpublic ValueReadQuery getTimestampQuery()
getTimestampQuery in interface PlatformgetTimestampQuery in class DatasourcePlatformpublic String getInOutputProcedureToken()
getInOutputProcedureToken in class DatabasePlatformpublic boolean shouldPrintOutputTokenAtStart()
shouldPrintOutputTokenAtStart in class DatabasePlatformpublic boolean isPostgreSQL()
isPostgreSQL in interface PlatformisPostgreSQL in class DatasourcePlatformprotected String getCreateTempTableSqlSuffix()
getCreateTempTableSqlSuffix in class DatabasePlatformpublic boolean supportsNativeSequenceNumbers()
supportsNativeSequenceNumbers in class DatabasePlatformpublic boolean shouldNativeSequenceAcquireValueAfterInsert()
shouldNativeSequenceAcquireValueAfterInsert in class DatabasePlatformpublic ValueReadQuery buildSelectQueryForNativeSequence(String seqName, Integer size)
buildSelectQueryForNativeSequence in class DatabasePlatformprotected String getCreateTempTableSqlBodyForTable(DatabaseTable table)
getCreateTempTableSqlBodyForTable in class DatabasePlatformpublic void printFieldIdentityClause(Writer writer) throws ValidationException
printFieldIdentityClause in class DatabasePlatformValidationExceptionprotected Hashtable buildFieldTypes()
DatabasePlatformbuildFieldTypes in class DatabasePlatformprotected ExpressionOperator operatorLocate()
public boolean supportsGlobalTempTables()
supportsGlobalTempTables in class DatabasePlatformprotected String getCreateTempTableSqlPrefix()
getCreateTempTableSqlPrefix in class DatabasePlatformpublic int getMaxFieldNameSize()
getMaxFieldNameSize in class DatabasePlatformpublic String getProcedureBeginString()
getProcedureBeginString in class DatabasePlatformpublic String getProcedureEndString()
getProcedureEndString in class DatabasePlatformpublic String getProcedureCallHeader()
getProcedureCallHeader in class DatabasePlatformpublic String getAssignmentString()
getAssignmentString in class DatabasePlatformpublic void printFieldTypeSize(Writer writer, FieldDefinition field, FieldTypeDefinition fieldType, AbstractSession session, String qualifiedFieldName) throws IOException
printFieldTypeSize in class DatabasePlatformIOExceptionpublic void printFieldUnique(Writer writer, boolean isUnique, AbstractSession session, String qualifiedFieldName) throws IOException
printFieldUnique in class DatabasePlatformIOExceptionpublic boolean shouldUseJDBCOuterJoinSyntax()
shouldUseJDBCOuterJoinSyntax in class DatabasePlatformprotected void setPrimitiveParameterValue(PreparedStatement statement, int index, Object parameter) throws SQLException
setPrimitiveParameterValue in class DatabasePlatformSQLExceptionpublic void platformSpecificSequencingInitialization(DatabaseSession session)
platformSpecificSequencingInitialization in interface PlatformplatformSpecificSequencingInitialization in class DatasourcePlatformCopyright © 2025. All rights reserved.