java.lang.Object
org.eclipse.persistence.internal.databaseaccess.DatasourcePlatform
org.eclipse.persistence.internal.databaseaccess.DatabasePlatform
org.eclipse.persistence.platform.database.DatabasePlatform
org.eclipse.persistence.platform.database.PostgreSQLPlatform
- All Implemented Interfaces:
Serializable,Cloneable,org.eclipse.persistence.internal.core.databaseaccess.CorePlatform<org.eclipse.persistence.internal.helper.ConversionManager>,org.eclipse.persistence.internal.databaseaccess.Platform,DDLPlatform
- Direct Known Subclasses:
PostgreSQL10Platform
Purpose: Provides Postgres specific behavior.
Responsibilities:
- Native SQL for Date, Time, & Timestamp.
- SQL time types with with fractional seconds precision support.
- Native sequencing.
- Mapping of class types to database types for the schema framework.
- Pessimistic locking.
- Platform specific operators.
- LIMIT/OFFSET query syntax for select statements.
- See Also:
-
Field Summary
Fields inherited from class org.eclipse.persistence.platform.database.DatabasePlatform
DEFAULT_VARCHAR_SIZEFields inherited from class org.eclipse.persistence.internal.databaseaccess.DatabasePlatform
batchWritingMechanism, castSizeForVarcharParameter, cursorCode, DEFAULT_MAX_BATCH_WRITING_SIZE, DEFAULT_PARAMETERIZED_MAX_BATCH_WRITING_SIZE, driverName, driverSupportsNationalCharacterVarying, IS_VALID_TIMEOUT, isCastRequired, maxBatchWritingSize, partitioningCallback, pingSQL, printInnerJoinInWhereClause, printOuterJoinInWhereClause, shouldBindAllParameters, shouldBindLiterals, shouldBindPartialParameters, shouldCacheAllStatements, shouldForceBindAllParameters, shouldForceFieldNamesToUpperCase, shouldIgnoreCaseOnFieldComparisons, shouldOptimizeDataConversion, shouldTrimStrings, statementCacheSize, stringBindingSize, structConverters, supportsAutoCommit, transactionIsolation, typeConverters, useJDBCStoredProcedureSyntax, useNationalCharacterVarying, useRownumFiltering, usesBatchWriting, usesByteArrayBinding, usesJDBCBatchWriting, usesNativeBatchWriting, usesNativeSQL, usesStreamsForBinding, usesStringBindingFields inherited from class org.eclipse.persistence.internal.databaseaccess.DatasourcePlatform
conversionManager, dataTypesConvertedFromAClass, dataTypesConvertedToAClass, defaultNativeSequenceToTable, defaultSeqenceAtNextValue, defaultSequence, endDelimiter, platformOperators, sequences, sequencesLock, startDelimiter, supportsReturnGeneratedKeys, tableQualifier, timestampQuery, uuidQueryFields inherited from interface org.eclipse.persistence.tools.schemaframework.DDLPlatform
CLASS_TYPES, DB_TYPES, TYPE_BIG_DECIMAL, TYPE_BIG_INTEGER, TYPE_BINARY, TYPE_BLOB, TYPE_BOOLEAN, TYPE_BYTE, TYPE_CHAR, TYPE_CLOB, TYPE_DATE, TYPE_DOUBLE, TYPE_FLOAT, TYPE_INTEGER, TYPE_LONG, TYPE_NUMBER, TYPE_NUMERIC, TYPE_SHORT, TYPE_TIME, TYPE_TIMESTAMP, TYPE_VARCHAR -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidappendBoolean(Boolean bool, Writer writer) Appends a Boolean value.intappendParameterInternal(Call call, Writer writer, Object parameter) Returns the number of parameters that used binding.org.eclipse.persistence.internal.databaseaccess.DatabaseCallbuildCallWithReturning(SQLCall sqlCall, List<org.eclipse.persistence.internal.helper.DatabaseField> returnFields) INTERNAL: Uses the returning clause on Postgres.protected Map<Class<?>, FieldDefinition.DatabaseType> Return the mapping of class types to database types for the schema framework.INTERNAL: Returns query used to read back the value generated by Identity.buildSelectQueryForSequenceObject(String qualifiedSeqName, Integer size) INTERNAL: Returns query used to read value generated by sequence object (like Oracle sequence).booleanINTERNAL: Postgres has a returning clause.intcomputeMaxRowsForSQL(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.INTERNAL Used for stored function calls.protected StringINTERNAL:protected StringINTERNAL:Allows DROP TABLE to cascade dropping of any dependent constraints if the database supports this option.This method is used to print the output parameter token when stored procedures are calledintgetJDBCType(Class<?> javaType) Return the JDBC type for the Java type.intINTERNAL: returns the maximum number of characters that can be used in a field name on this platform.Used for stored procedure defs.INTERNAL: Used for sp calls.Used for stored procedure defs.INTERNAL: This method returns the query to select the timestamp from the server for Postgres.This method can be overridden by subclasses to return a query that will return the UUID from the server.protected voidINTERNAL: Initialize any platform-specific operatorsbooleanINTERNAL: Override this method if the platform supports sequence objects and it's possible to alter sequence object's increment in the database.booleanCalling 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.booleanINTERNAL: Answers whether platform is Postgres.protected ExpressionOperatorINTERNAL: Override the default locate operator.protected ExpressionOperatorINTERNAL: Override the default locate operator.voidprintFieldIdentityClause(Writer writer) Prints the platform-specific identity clause for a field (e.g., AUTO_INCREMENT).voidprintFieldUnique(Writer writer, boolean shouldPrintFieldIdentityClause) Prints the platform-specific UNIQUE clause for a field.voidprintSQLSelectStatement(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 ExpressionOperatorINTERNAL: Create the ~ operator.protected voidsetNullFromDatabaseField(org.eclipse.persistence.internal.helper.DatabaseField databaseField, PreparedStatement statement, int index) voidsetParameterValueInDatabaseCall(Object parameter, CallableStatement statement, String name, org.eclipse.persistence.internal.sessions.AbstractSession session) INTERNAL Set the parameter in the JDBC statement at the given index in case it is a UUID value.voidsetParameterValueInDatabaseCall(Object parameter, PreparedStatement statement, int index, org.eclipse.persistence.internal.sessions.AbstractSession session) INTERNAL Set the parameter in the JDBC statement at the given index in case it is a UUID value.booleanINTERNAL: Indicates whether locking OF clause should print alias for field.booleanThis is required in the construction of the stored procedures with output parametersbooleanINTERNAL: Should the variable name of a stored procedure call be printed as part of the procedure call e.g.booleanJDBC defines and outer join syntax, many drivers do not support this.booleanOverride this method if the platform supports setting fractional seconds precision in a SQL time or timestamp data type.booleanINTERNAL: Indicates whether the platform supports identity.booleanINTERNAL:booleanINTERNAL: Indicates whether the platform supports sequence objects.protected ExpressionOperatorINTERNAL: Postgres to_number has two arguments, as fix format argument.voidwriteUpdateOriginalFromTempTableSql(Writer writer, org.eclipse.persistence.internal.helper.DatabaseTable table, Collection<org.eclipse.persistence.internal.helper.DatabaseField> pkFields, Collection<org.eclipse.persistence.internal.helper.DatabaseField> assignedFields) INTERNAL: May need to override this method if the platform supports temporary tables and the generated sql doesn't work.Methods inherited from class org.eclipse.persistence.internal.databaseaccess.DatabasePlatform
addBatch, addStructConverter, allowBindingForSelectClause, appendByteArray, appendCalendar, appendDate, appendLiteralToCall, appendLiteralToCallWithBinding, appendNumber, appendParameter, appendString, appendTime, appendTimestamp, autoCommit, beginTransaction, buildBatchCriteria, buildBatchCriteriaForComplexId, buildCreateIndex, buildDropIndex, buildJavaTypes, buildProcedureCallString, canBatchWriteWithOptimisticLocking, checkSequenceExists, checkTableExists, commitTransaction, convertToDatabaseType, copyInto, createArray, createArray, createPlatformDefaultSequence, createStruct, createStruct, createStruct, dontBindUpdateAllQueryUsingTempTables, executeBatch, executeStoredProcedure, freeTemporaryObject, getBatchRowCountAssignString, getBatchRowCountDeclareString, getBatchRowCountReturnString, getBatchWritingMechanism, getCastSizeForVarcharParameter, getConnection, getConnectionUserName, getCreateTempTableSqlBodyForTable, getCursorCode, getCustomModifyValueForCall, getDatabaseType, getDatabaseTypes, getDefaultSequenceTableName, getDriverSupportsNVarChar, getExecuteBatchRowCounts, getFunctionCallHeader, getJavaTypes, getJDBCOuterJoinString, getJDBCType, getJDBCTypeForSetNull, getJdbcTypeName, getJsonPlatform, getMaxBatchWritingSize, getNoWaitString, getObjectFromResultSet, getParameterValueFromDatabaseCall, getParameterValueFromDatabaseCall, getPartitioningCallback, getPingSQL, getProcedureArgument, getProcedureCallTail, getQualifiedName, getQualifiedSequenceTableName, getRefValue, getRefValue, getSelectForUpdateNoWaitString, getSelectForUpdateOfString, getSelectForUpdateString, getSelectForUpdateWaitString, getSequenceCounterFieldName, getSequenceNameFieldName, getSequenceTableName, getStatementCacheSize, getStoredProcedureParameterPrefix, getStoredProcedureTerminationToken, getStringBindingSize, getStructConverters, getTableCreationSuffix, getTableExistsQuery, getTempTableForTable, getTransactionIsolation, getTypeConverters, getUseNationalCharacterVaryingTypeForString, getVPDClearIdentifierQuery, getVPDCreationFunctionString, getVPDCreationPolicyString, getVPDDeletionString, getVPDSetIdentifierQuery, hasPartitioningCallback, initialize, initializeConnectionData, isCastRequired, isDynamicSQLRequiredForFunctions, isForUpdateCompatibleWithDistinct, isInformixOuterJoin, isLobCompatibleWithDistinct, isLockTimeoutException, isNullAllowedInSelectClause, isOutputAllowWithResultSet, isRowCountOutputParameterRequired, isXDBDocument, maximumNumericValues, minimumNumericValues, minimumTimeIncrement, prepareBatchStatement, printStoredFunctionReturnKeyWord, printValuelist, printValuelist, registerOutputParameter, registerOutputParameter, registerOutputParameter, registerOutputParameter, requiresProcedureCallBrackets, requiresProcedureCallOuputToken, requiresTypeNameToRegisterOutputParameter, retrieveFirstPrimaryKeyOrOne, rollbackTransaction, setBatchWritingMechanism, setCastSizeForVarcharParameter, setCursorCode, setDatabaseTypes, setDriverName, setDriverSupportsNVarChar, setExecuteBatchRowCounts, setIsCastRequired, setJavaTypes, setMaxBatchWritingSize, setNullFromDatabaseField, setPartitioningCallback, setPingSQL, setPrintInnerJoinInWhereClause, setPrintOuterJoinInWhereClause, setSequenceCounterFieldName, setSequenceNameFieldName, setSequenceTableName, setShouldBindAllParameters, setShouldBindLiterals, setShouldBindPartialParameters, setShouldCacheAllStatements, setShouldCreateIndicesOnForeignKeys, setShouldForceBindAllParameters, setShouldForceFieldNamesToUpperCase, setShouldIgnoreCaseOnFieldComparisons, setShouldOptimizeDataConversion, setShouldTrimStrings, setShouldUseRownumFiltering, setStatementCacheSize, setStoredProcedureTerminationToken, setStringBindingSize, setSupportsAutoCommit, setTableCreationSuffix, setTransactionIsolation, setUseJDBCStoredProcedureSyntax, setUseNationalCharacterVaryingTypeForString, setUsesBatchWriting, setUsesByteArrayBinding, setUsesJDBCBatchWriting, setUsesNativeBatchWriting, setUsesNativeSQL, setUsesStreamsForBinding, setUsesStringBinding, shouldAlwaysUseTempStorageForModifyAll, shouldBindAllParameters, shouldBindLiterals, shouldBindPartialParameters, shouldCacheAllStatements, shouldCreateIndicesOnForeignKeys, shouldForceBindAllParameters, shouldForceFieldNamesToUpperCase, shouldIgnoreCaseOnFieldComparisons, shouldIgnoreException, shouldOptimizeDataConversion, shouldPrintFieldIdentityClause, shouldPrintForUpdateClause, shouldPrintInnerJoinInWhereClause, shouldPrintInOutputTokenBeforeType, shouldPrintLockingClauseAfterWhereClause, shouldPrintOuterJoinInWhereClause, shouldTempTableSpecifyPrimaryKeys, shouldTrimStrings, shouldUseCustomModifyForCall, shouldUseGetSetNString, shouldUseRownumFiltering, supportsANSIInnerJoinSyntax, supportsAutoCommit, supportsAutoConversionToNumericForArithmeticOperations, supportsConnectionUserName, supportsCountDistinctWithMultipleFields, supportsGlobalTempTables, supportsIndividualTableLocking, supportsLockingQueriesWithMultipleTables, supportsNestingOuterJoins, supportsOrderByParameters, supportsOuterJoinsWithBrackets, supportsTempTables, supportsVPD, supportsWaitForUpdate, usesBatchWriting, usesByteArrayBinding, usesJDBCBatchWriting, usesNativeBatchWriting, usesNativeSQL, usesSequenceTable, usesStreamsForBinding, usesStringBinding, wasFailureCommunicationBased, writeAddColumnClause, writeAutoAssignmentSetClause, writeAutoJoinWhereClause, writeCleanUpTempTableSql, writeCreateTempTableSql, writeDeleteFromTargetTableUsingTempTableSql, writeDropColumnClause, writeFields, writeFieldsAutoClause, writeFieldsList, writeInsertIntoTableSql, writeJoinWhereClause, writeLOB, writeParameterMarker, writeTruncateTableMethods inherited from class org.eclipse.persistence.internal.databaseaccess.DatasourcePlatform
addOperator, addSequence, addSequence, buildNativeCall, buildSelectQueryForIdentity, buildSelectQueryForSequenceObject, clone, convertObject, convertObject, createConnectionCustomizer, createExpressionFor, getConversionManager, getDataTypesConvertedFrom, getDataTypesConvertedTo, getDefaultNativeSequenceToTable, getDefaultSeqenceAtNextValue, getDefaultSequence, getDefaultSequenceToWrite, getDriverVersion, getEndDelimiter, getINClauseLimit, getOperator, getPlatformOperators, getSelectSequenceQuery, getSequence, getSequencePreallocationSize, getSequences, getSequencesToWrite, getStartDelimiter, getTableQualifier, getTimestampFromServer, getUpdateSequenceQuery, hasDefaultSequence, initializeDefaultQueries, isAccess, isAttunity, isCloudscape, isDB2, isDB2Z, isDBase, isDerby, isFirebird, isH2, isHANA, isHSQL, isInformix, isMariaDB, isMaxDB, isMySQL, isODBC, isOracle, isOracle12, isOracle23, isOracle9, isPervasive, isPointBase, isSQLAnywhere, isSQLServer, isSybase, isSymfoware, isTimesTen, isTimesTen7, removeAllSequences, removeSequence, sequencesAfterCloneCleanup, setConversionManager, setDefaultNativeSequenceToTable, setDefaultSeqenceAtNextValue, setDefaultSequence, setEndDelimiter, setSelectSequenceNumberQuery, setSequencePreallocationSize, setSequences, setStartDelimiter, setSupportsReturnGeneratedKeys, setTableQualifier, setTimestampQuery, setUpdateSequenceQuery, setUUIDQuery, shouldNativeSequenceUseTransaction, shouldPrepare, shouldSelectDistinctIncludeOrderBy, shouldSelectIncludeOrderBy, supportsNativeSequenceNumbers, supportsReturnGeneratedKeys, toString, usesPlatformDefaultSequenceMethods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.eclipse.persistence.tools.schemaframework.DDLPlatform
allowsSizeInProcedureArguments, buildCreateIndex, buildDropIndex, buildSequenceObjectAlterIncrementWriter, buildSequenceObjectCreationWriter, buildSequenceObjectDeletionWriter, getBatchBeginString, getBatchDelimiterString, getBatchEndString, getConstraintDeletionString, getCreateDatabaseSchemaString, getCreateViewString, getCreationInOutputProcedureToken, getCreationOutputProcedureToken, getDatabaseType, getDatabaseType, getDropDatabaseSchemaString, getEndDelimiter, getIndexNamePrefix, getInputProcedureToken, getMaxForeignKeyNameSize, getMaxIndexNameSize, getMaxUniqueKeyNameSize, getOutputProcedureToken, getProcedureArgumentString, getProcedureAsString, getProcedureOptionList, getStartDelimiter, getUniqueConstraintDeletionString, printFieldNotNullClause, printFieldNullClause, printFieldTypeSize, printFieldTypeSize, requiresNamedPrimaryKeyConstraints, requiresProcedureBrackets, requiresTableInIndexDropDDL, requiresUniqueConstraintCreationOnTableCreate, shouldCreateIndicesForPrimaryKeys, shouldCreateIndicesOnUniqueKeys, shouldPrintConstraintNameAfter, shouldPrintInputTokenAtStart, shouldPrintOutputTokenBeforeType, shouldPrintStoredProcedureVariablesAfterBeginString, supportsDeleteOnCascade, supportsForeignKeyConstraints, supportsIndexes, supportsPrimaryKeyConstraint, supportsStoredFunctions, supportsUniqueColumns, supportsUniqueKeyConstraints, writeTableCreationSuffixMethods inherited from interface org.eclipse.persistence.internal.databaseaccess.Platform
connectionProperties
-
Constructor Details
-
PostgreSQLPlatform
public PostgreSQLPlatform()
-
-
Method Details
-
getJDBCType
Return the JDBC type for the Java type. For some reason PostgreSQL does not seem to like the JDBC Blob type (PostgreSQL 8.2).- Overrides:
getJDBCTypein classorg.eclipse.persistence.internal.databaseaccess.DatabasePlatform
-
appendBoolean
Appends a Boolean value. Refer to : http://www.postgresql.org/docs/8.0/static/datatype-boolean.html In PostgreSQL the following are the values that are value for a boolean field Valid literal values for the "true" state are: TRUE, 't', 'true', 'y', 'yes', '1' Valid literal values for the false" state are : FALSE, 'f', 'false', 'n', 'no', '0'To be consistent with the other data platforms we are using the values '1' and '0' for true and false states of a boolean field.
- Overrides:
appendBooleanin classorg.eclipse.persistence.internal.databaseaccess.DatabasePlatform- Throws:
IOException
-
computeMaxRowsForSQL
public 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. These limits tend to be used in two ways.1. MaxRows is the index of the last row to be returned (like JDBC maxResults) 2. MaxRows is the number of rows to be returned
PostGreSQL uses case #2 and therefore the maxResults has to be altered based on the firstResultIndex
- Overrides:
computeMaxRowsForSQLin classorg.eclipse.persistence.internal.databaseaccess.DatabasePlatform- See Also:
-
initializePlatformOperators
protected void initializePlatformOperators()INTERNAL: Initialize any platform-specific operators- Overrides:
initializePlatformOperatorsin classorg.eclipse.persistence.internal.databaseaccess.DatasourcePlatform
-
regexpOperator
INTERNAL: Create the ~ operator. REGEXP allows for comparison through regular expression. -
toNumberOperator
INTERNAL: Postgres to_number has two arguments, as fix format argument. -
getTimestampQuery
INTERNAL: This method returns the query to select the timestamp from the server for Postgres.- Specified by:
getTimestampQueryin interfaceorg.eclipse.persistence.internal.databaseaccess.Platform- Overrides:
getTimestampQueryin classorg.eclipse.persistence.internal.databaseaccess.DatasourcePlatform
-
shouldPrintStoredProcedureArgumentNameInCall
public boolean shouldPrintStoredProcedureArgumentNameInCall()INTERNAL: Should the variable name of a stored procedure call be printed as part of the procedure call e.g. EXECUTE PROCEDURE MyStoredProc(myvariable = ?) In case of PostgreSQL NO as JDBC driver and DB doesn't support pass parameters by name. It expects, that parameters are passed by index or persistence property<property name="eclipselink.jpa.naming_into_indexed" value="true"/>is used.- Overrides:
shouldPrintStoredProcedureArgumentNameInCallin classorg.eclipse.persistence.internal.databaseaccess.DatabasePlatform
-
isJDBCExecuteCompliant
public 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. This flag will help avoid throwing a JPA mandated exception on an executeUpdate call (which calls jdbc execute and checks the return value to ensure no results sets are returned (true)). PostgreSQL also doesn't support parameters passed by name in case of stored procedure calls.- Overrides:
isJDBCExecuteCompliantin classorg.eclipse.persistence.internal.databaseaccess.DatabasePlatform- See Also:
-
isPostgreSQL
public boolean isPostgreSQL()INTERNAL: Answers whether platform is Postgres.- Specified by:
isPostgreSQLin interfaceorg.eclipse.persistence.internal.databaseaccess.Platform- Overrides:
isPostgreSQLin classorg.eclipse.persistence.internal.databaseaccess.DatasourcePlatform
-
getCreateTempTableSqlSuffix
INTERNAL:- Overrides:
getCreateTempTableSqlSuffixin classorg.eclipse.persistence.internal.databaseaccess.DatabasePlatform
-
shouldPrintAliasForUpdate
public boolean shouldPrintAliasForUpdate()INTERNAL: Indicates whether locking OF clause should print alias for field. Example: on Oracle platform (method returns false): SELECT ADDRESS_ID, ... FROM ADDRESS T1 WHERE (T1.ADDRESS_ID = ?) FOR UPDATE OF T1.ADDRESS_ID on Postgres platform (method returns true): SELECT ADDRESS_ID, ... FROM ADDRESS T1 WHERE (T1.ADDRESS_ID = ?) FOR UPDATE OF T1- Overrides:
shouldPrintAliasForUpdatein classorg.eclipse.persistence.internal.databaseaccess.DatabasePlatform
-
supportsIdentity
public boolean supportsIdentity()INTERNAL: Indicates whether the platform supports identity.- Overrides:
supportsIdentityin classorg.eclipse.persistence.internal.databaseaccess.DatasourcePlatform
-
buildSelectQueryForIdentity
INTERNAL: Returns query used to read back the value generated by Identity. This method is called when identity NativeSequence is connected, the returned query used until the sequence is disconnected. If the platform supportsIdentity then (at least) one of buildSelectQueryForIdentity methods should return non-null query.- Overrides:
buildSelectQueryForIdentityin classorg.eclipse.persistence.internal.databaseaccess.DatasourcePlatform
-
supportsSequenceObjects
public boolean supportsSequenceObjects()INTERNAL: Indicates whether the platform supports sequence objects.- Overrides:
supportsSequenceObjectsin classorg.eclipse.persistence.internal.databaseaccess.DatasourcePlatform
-
buildSelectQueryForSequenceObject
INTERNAL: Returns query used to read value generated by sequence object (like Oracle sequence). This method is called when sequence object NativeSequence is connected, the returned query used until the sequence is disconnected. If the platform supportsSequenceObjects then (at least) one of buildSelectQueryForSequenceObject methods should return non-null query.- Overrides:
buildSelectQueryForSequenceObjectin classorg.eclipse.persistence.internal.databaseaccess.DatasourcePlatform
-
operatorLocate
INTERNAL: Override the default locate operator. -
operatorLocate2
INTERNAL: Override the default locate operator. -
supportsLocalTempTables
public boolean supportsLocalTempTables()INTERNAL:- Overrides:
supportsLocalTempTablesin classorg.eclipse.persistence.internal.databaseaccess.DatabasePlatform
-
getCreateTempTableSqlPrefix
INTERNAL:- Overrides:
getCreateTempTableSqlPrefixin classorg.eclipse.persistence.internal.databaseaccess.DatabasePlatform
-
getProcedureCallHeader
INTERNAL: Used for sp calls.- Overrides:
getProcedureCallHeaderin classorg.eclipse.persistence.internal.databaseaccess.DatabasePlatform
-
getAssignmentString
INTERNAL Used for stored function calls.- Overrides:
getAssignmentStringin classorg.eclipse.persistence.internal.databaseaccess.DatabasePlatform
-
shouldUseJDBCOuterJoinSyntax
public boolean shouldUseJDBCOuterJoinSyntax()JDBC defines and outer join syntax, many drivers do not support this. So we normally avoid it.- Overrides:
shouldUseJDBCOuterJoinSyntaxin classorg.eclipse.persistence.internal.databaseaccess.DatabasePlatform
-
printSQLSelectStatement
public 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>".- Overrides:
printSQLSelectStatementin classorg.eclipse.persistence.internal.databaseaccess.DatabasePlatform
-
writeUpdateOriginalFromTempTableSql
public void writeUpdateOriginalFromTempTableSql(Writer writer, org.eclipse.persistence.internal.helper.DatabaseTable table, Collection<org.eclipse.persistence.internal.helper.DatabaseField> pkFields, Collection<org.eclipse.persistence.internal.helper.DatabaseField> assignedFields) throws IOException INTERNAL: May need to override this method if the platform supports temporary tables and the generated sql doesn't work. Write an sql string for updating the original table from the temporary table. Precondition: supportsTempTables() == true. Precondition: pkFields and assignFields don't intersect.- Overrides:
writeUpdateOriginalFromTempTableSqlin classorg.eclipse.persistence.internal.databaseaccess.DatabasePlatform- Parameters:
writer- 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.- Throws:
IOException
-
canBuildCallWithReturning
public boolean canBuildCallWithReturning()INTERNAL: Postgres has a returning clause.- Overrides:
canBuildCallWithReturningin classorg.eclipse.persistence.internal.databaseaccess.DatabasePlatform
-
buildCallWithReturning
public org.eclipse.persistence.internal.databaseaccess.DatabaseCall buildCallWithReturning(SQLCall sqlCall, List<org.eclipse.persistence.internal.helper.DatabaseField> returnFields) INTERNAL: Uses the returning clause on Postgres.- Overrides:
buildCallWithReturningin classorg.eclipse.persistence.internal.databaseaccess.DatabasePlatform
-
setNullFromDatabaseField
protected void setNullFromDatabaseField(org.eclipse.persistence.internal.helper.DatabaseField databaseField, PreparedStatement statement, int index) throws SQLException - Overrides:
setNullFromDatabaseFieldin classorg.eclipse.persistence.internal.databaseaccess.DatabasePlatform- Throws:
SQLException
-
setParameterValueInDatabaseCall
public void setParameterValueInDatabaseCall(Object parameter, PreparedStatement statement, int index, org.eclipse.persistence.internal.sessions.AbstractSession session) throws SQLException INTERNAL Set the parameter in the JDBC statement at the given index in case it is a UUID value.- Overrides:
setParameterValueInDatabaseCallin classorg.eclipse.persistence.internal.databaseaccess.DatabasePlatform- Parameters:
parameter- the parameter to setstatement- targetPreparedStatementinstanceindex- index of the parameter in the statementsession- current database session- Throws:
SQLException
-
setParameterValueInDatabaseCall
public void setParameterValueInDatabaseCall(Object parameter, CallableStatement statement, String name, org.eclipse.persistence.internal.sessions.AbstractSession session) throws SQLException INTERNAL Set the parameter in the JDBC statement at the given index in case it is a UUID value.- Overrides:
setParameterValueInDatabaseCallin classorg.eclipse.persistence.internal.databaseaccess.DatabasePlatform- Parameters:
parameter- the parameter to setstatement- targetCallableStatementinstancename- name of the parameter in the statementsession- current database session- Throws:
SQLException
-
getUUIDQuery
Description copied from class:org.eclipse.persistence.internal.databaseaccess.DatasourcePlatformThis method can be overridden by subclasses to return a query that will return the UUID from the server. return null if UUID can't be generated by platform.- Specified by:
getUUIDQueryin interfaceorg.eclipse.persistence.internal.databaseaccess.Platform- Overrides:
getUUIDQueryin classorg.eclipse.persistence.internal.databaseaccess.DatasourcePlatform
-
appendParameterInternal
Description copied from class:org.eclipse.persistence.internal.databaseaccess.DatabasePlatformReturns the number of parameters that used binding. Should only be called in case binding is not used.- Overrides:
appendParameterInternalin classorg.eclipse.persistence.internal.databaseaccess.DatabasePlatform
-
buildDatabaseTypes
Description copied from class:org.eclipse.persistence.internal.databaseaccess.DatabasePlatformReturn the mapping of class types to database types for the schema framework.- Overrides:
buildDatabaseTypesin classorg.eclipse.persistence.internal.databaseaccess.DatabasePlatform
-
getDropCascadeString
Description copied from interface:DDLPlatformAllows DROP TABLE to cascade dropping of any dependent constraints if the database supports this option. -
getInOutputProcedureToken
Description copied from interface:DDLPlatformThis method is used to print the output parameter token when stored procedures are called -
getMaxFieldNameSize
public int getMaxFieldNameSize()Description copied from interface:DDLPlatformINTERNAL: returns the maximum number of characters that can be used in a field name on this platform. -
getProcedureBeginString
Description copied from interface:DDLPlatformUsed for stored procedure defs. -
getProcedureEndString
Description copied from interface:DDLPlatformUsed for stored procedure defs. -
isAlterSequenceObjectSupported
public boolean isAlterSequenceObjectSupported()Description copied from interface:DDLPlatformINTERNAL: Override this method if the platform supports sequence objects and it's possible to alter sequence object's increment in the database. -
printFieldIdentityClause
Description copied from interface:DDLPlatformPrints the platform-specific identity clause for a field (e.g., AUTO_INCREMENT).- Parameters:
writer- the writer to append to- Throws:
ValidationException
-
printFieldUnique
public void printFieldUnique(Writer writer, boolean shouldPrintFieldIdentityClause) throws IOException Description copied from interface:DDLPlatformPrints the platform-specific UNIQUE clause for a field.- Parameters:
writer- the writer to append toshouldPrintFieldIdentityClause- indicates if the identity clause should be printed- Throws:
IOException- if an I/O error occurs while writing
-
shouldPrintOutputTokenAtStart
public boolean shouldPrintOutputTokenAtStart()Description copied from interface:DDLPlatformThis is required in the construction of the stored procedures with output parameters -
supportsFractionalTime
public boolean supportsFractionalTime()Description copied from interface:DDLPlatformOverride this method if the platform supports setting fractional seconds precision in a SQL time or timestamp data type.- Returns:
- value of
truewhen current database platform supports fractional seconds precision orfalseotherwise
-