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, usesStringBinding
conversionManager, 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, writeUpdateOriginalFromTempTableSql
addOperator, 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, usesPlatformDefaultSequence
protected void appendBoolean(Boolean bool, Writer writer) throws IOException
appendBoolean
in class DatabasePlatform
IOException
protected void initializePlatformOperators()
initializePlatformOperators
in class DatasourcePlatform
public ValueReadQuery getTimestampQuery()
getTimestampQuery
in interface Platform
getTimestampQuery
in class DatasourcePlatform
public String getInOutputProcedureToken()
getInOutputProcedureToken
in class DatabasePlatform
public boolean shouldPrintOutputTokenAtStart()
shouldPrintOutputTokenAtStart
in class DatabasePlatform
public boolean isPostgreSQL()
isPostgreSQL
in interface Platform
isPostgreSQL
in class DatasourcePlatform
protected String getCreateTempTableSqlSuffix()
getCreateTempTableSqlSuffix
in class DatabasePlatform
public boolean supportsNativeSequenceNumbers()
supportsNativeSequenceNumbers
in class DatabasePlatform
public boolean shouldNativeSequenceAcquireValueAfterInsert()
shouldNativeSequenceAcquireValueAfterInsert
in class DatabasePlatform
public ValueReadQuery buildSelectQueryForNativeSequence(String seqName, Integer size)
buildSelectQueryForNativeSequence
in class DatabasePlatform
protected String getCreateTempTableSqlBodyForTable(DatabaseTable table)
getCreateTempTableSqlBodyForTable
in class DatabasePlatform
public void printFieldIdentityClause(Writer writer) throws ValidationException
printFieldIdentityClause
in class DatabasePlatform
ValidationException
protected Hashtable buildFieldTypes()
DatabasePlatform
buildFieldTypes
in class DatabasePlatform
protected ExpressionOperator operatorLocate()
public boolean supportsGlobalTempTables()
supportsGlobalTempTables
in class DatabasePlatform
protected String getCreateTempTableSqlPrefix()
getCreateTempTableSqlPrefix
in class DatabasePlatform
public int getMaxFieldNameSize()
getMaxFieldNameSize
in class DatabasePlatform
public String getProcedureBeginString()
getProcedureBeginString
in class DatabasePlatform
public String getProcedureEndString()
getProcedureEndString
in class DatabasePlatform
public String getProcedureCallHeader()
getProcedureCallHeader
in class DatabasePlatform
public String getAssignmentString()
getAssignmentString
in class DatabasePlatform
public void printFieldTypeSize(Writer writer, FieldDefinition field, FieldTypeDefinition fieldType, AbstractSession session, String qualifiedFieldName) throws IOException
printFieldTypeSize
in class DatabasePlatform
IOException
public void printFieldUnique(Writer writer, boolean isUnique, AbstractSession session, String qualifiedFieldName) throws IOException
printFieldUnique
in class DatabasePlatform
IOException
public boolean shouldUseJDBCOuterJoinSyntax()
shouldUseJDBCOuterJoinSyntax
in class DatabasePlatform
protected void setPrimitiveParameterValue(PreparedStatement statement, int index, Object parameter) throws SQLException
setPrimitiveParameterValue
in class DatabasePlatform
SQLException
public void platformSpecificSequencingInitialization(DatabaseSession session)
platformSpecificSequencingInitialization
in interface Platform
platformSpecificSequencingInitialization
in class DatasourcePlatform
Copyright © 2024. All rights reserved.