Top Description Fields Constructors Methods
org.eclipse.persistence.internal.databaseaccess

public Class DatabasePlatform

extends DatasourcePlatform
Class Inheritance
Known Direct Subclasses
org.eclipse.persistence.platform.database.DatabasePlatform
Imports
java.io.ByteArrayInputStream, .CharArrayReader, .IOException, .StringWriter, .Writer, java.math.BigDecimal, .BigInteger, java.sql.Array, .CallableStatement, .Connection, .PreparedStatement, .Ref, .ResultSet, .SQLException, .SQLXML, .Statement, .Struct, .Types, java.util.Calendar, .Collection, .HashMap, .Hashtable, .Iterator, .List, .Map, .UUID, .Vector, org.eclipse.persistence.descriptors.ClassDescriptor, org.eclipse.persistence.exceptions.DatabaseException, .ValidationException, org.eclipse.persistence.expressions.Expression, .ExpressionBuilder, org.eclipse.persistence.internal.databaseaccess.DatasourceCall.ParameterType, org.eclipse.persistence.internal.expressions.ExpressionSQLPrinter, .ParameterExpression, .SQLSelectStatement, org.eclipse.persistence.internal.helper.ClassConstants, .ConversionManager, .DatabaseField, .DatabaseTable, .Helper, .JavaPlatform, org.eclipse.persistence.internal.sequencing.Sequencing, org.eclipse.persistence.internal.sessions.AbstractRecord, .AbstractSession, .DatabaseSessionImpl, org.eclipse.persistence.logging.SessionLog, org.eclipse.persistence.mappings.ForeignReferenceMapping, org.eclipse.persistence.mappings.structures.ObjectRelationalDatabaseField, org.eclipse.persistence.platform.database.AccessPlatform, .DB2Platform, .DBasePlatform, .OraclePlatform, .PostgreSQLPlatform, .SybasePlatform, .SymfowarePlatform, org.eclipse.persistence.platform.database.converters.StructConverter, org.eclipse.persistence.platform.database.partitioning.DataPartitioningCallback, org.eclipse.persistence.queries.Call, .DataReadQuery, .DatabaseQuery, .ObjectBuildingQuery, .ReadQuery, .ReportQuery, .SQLCall, .StoredProcedureCall, org.eclipse.persistence.sequencing.Sequence, .TableSequence, org.eclipse.persistence.sessions.SessionProfiler, org.eclipse.persistence.tools.schemaframework.FieldDefinition, .TableDefinition

DatabasePlatform is private to EclipseLink. It encapsulates behavior specific to a database platform (eg. Oracle, Sybase, DBase), and provides protocol for EclipseLink to access this behavior. The behavior categories which require platform specific handling are SQL generation and sequence behavior. While database platform currently provides sequence number retrieval behavior, this will move to a sequence manager (when it is implemented).
Since
TOPLink/Java 1.0
See Also
AccessPlatform, DB2Platform, DBasePlatform, OraclePlatform, SybasePlatform

Field Summary

Modifier and TypeField and Description
protected BatchWritingMechanism
batchWritingMechanism

Allow for a custom batch writing mechanism.

protected int
castSizeForVarcharParameter

used for casting of input parameters in certain DBs

protected transient Map<String, Class<?>>
classTypes

Stores mapping of class types to database types for schema creation.

protected int
cursorCode

Allow for the code that is used for preparing cursored outs for a storedprocedure to be settable.

public static final int
DEFAULT_MAX_BATCH_WRITING_SIZE

Bug#3214927 The default is 32000 for DynamicSQLBatchWritingMechanism.

public static final int
protected String
protected boolean
driverSupportsNationalCharacterVarying

True if the current jdbc driver supports get/setNString methods

protected transient Map<Class<?>, FieldTypeDefinition>
fieldTypes

Holds a map of values used to map JAVA types to database types for table creation

public static final int
IS_VALID_TIMEOUT

Timeout used is isValid() check for dead connections.

protected boolean
isCastRequired

Allow platform specific cast to be enabled.

private transient volatile DatabaseJsonPlatform
jsonPlatform

JSON support for ResultSet data retrieval.

protected int
maxBatchWritingSize

Allow for the batch size to be set as many database have strict limits.

protected DataPartitioningCallback
partitioningCallback

Used to integrate with data partitioning in an external DataSource such as UCP.

protected String
pingSQL

This attribute will store the SQL query that will be used to 'ping' the database connection in order to check the health of a connection.

protected Boolean
printInnerJoinInWhereClause

Allow configuration option to use Where clause joining or From clause joining.

protected Boolean
printOuterJoinInWhereClause

Allow configuration option to use Where clause outer joining or From clause joining.

protected Boolean
shouldBindAllParameters

Bind all arguments to any SQL statement.

protected boolean
shouldBindLiterals

Allow user to require literals to be bound.

protected boolean
shouldBindPartialParameters

Bind some arguments to any SQL statement.

protected boolean
shouldCacheAllStatements

Cache all prepared statements, this requires full parameter binding as well.

protected boolean
shouldCreateIndicesOnForeignKeys

Allows auto-indexing for foreign keys to be set.

protected boolean
shouldForceBindAllParameters

Bind all arguments to any SQL statement.

protected boolean
shouldForceFieldNamesToUpperCase

Can be used if the app expects upper case but the database is not return consistent case, i.e. different databases.

public static boolean
shouldIgnoreCaseOnFieldComparisons

Allow for case in field names to be ignored as some databases are not case sensitive and when using custom this can be an issue.

protected boolean
shouldOptimizeDataConversion

Allow for driver level data conversion optimization to be disabled, required because some drivers can loose precision.

protected boolean
shouldTrimStrings

Indicates (if true) to remove blanks characters from the right of CHAR strings.

protected int
statementCacheSize

The statement cache size for prepare parameterized statements.

protected String
storedProcedureTerminationToken

The delimiter between stored procedures in multiple stored procedure calls.

protected int
stringBindingSize

Indicates the size above which strings will be bound NOTE: does not work with ODBC

protected Map<String, StructConverter>
structConverters

The following two maps, provide two ways of looking up StructConverters.

protected boolean
supportsAutoCommit

Some JDBC drivers do not support AutoCommit in the way EclipseLink expects.

protected String
tableCreationSuffix

String used on all table creation statements generated from the DefaultTableGenerator with a session using this project.

protected int
transactionIsolation

The transaction isolation level to be set on the connection (optional).

protected Map<Class<?>, StructConverter>
protected Boolean
protected boolean
useNationalCharacterVarying

If true, the platform should map String columns to a type that supports national characters.

protected boolean
useRownumFiltering

Some platforms allow a query's maxRows and FirstResult settings to be specified in SQL.

protected boolean
usesBatchWriting

Batch all write statements

protected boolean
usesByteArrayBinding

Indicates that binding will be used for BLOB data.

protected boolean
usesJDBCBatchWriting

Allow for our batch writing support to be used in JDK 1.2.

protected boolean
usesNativeBatchWriting

bug 4241441: Allow custom batch writing to enable batching with optimistic locking.

protected boolean
usesNativeSQL

Indicates that native SQL should be used for literal values instead of ODBC escape format Only used with Oracle, Sybase & DB2

protected boolean
usesStreamsForBinding

Indicates that streams will be used to store BLOB data.

protected boolean
usesStringBinding

Indicates that strings will above the stringBindingSize will be bound NOTE: does not work with ODBC

Inherited from org.eclipse.persistence.internal.databaseaccess.DatasourcePlatform:
conversionManagerdataTypesConvertedFromAClassdataTypesConvertedToAClassdefaultNativeSequenceToTabledefaultSeqenceAtNextValuedefaultSequenceendDelimiterplatformOperatorssequencessequencesLockstartDelimitersupportsReturnGeneratedKeystableQualifiertimestampQueryuuidQuery

Constructor Summary

AccessConstructor and Description
public
DatabasePlatform()

Creates an instance of default database platform.

Method Summary

Modifier and TypeMethod and Description
public int

Returns:

- number of rows modified/deleted by this statement if it was executed (0 if it wasn't)
addBatch
(PreparedStatement statement)

INTERNAL: This gets called on each iteration to add parameters to the batch Needs to be implemented so that it returns the number of rows successfully modified by this statement for optimistic locking purposes (if useNativeBatchWriting is enabled, and the call uses optimistic locking).

public void
addStructConverter(StructConverter converter)

PUBLIC: Add a StructConverter to this DatabasePlatform This StructConverter will be invoked for all writes to the database for the class returned by its getJavaType() method and for all reads from the database for the Structs described by its getStructName() method

public boolean
public boolean
allowsSizeInProcedureArguments()

Used for stored procedure definitions.

protected void
appendBoolean(Boolean bool, Writer writer)

Appends a Boolean value as a number

protected void
appendByteArray(byte[] bytes, Writer writer)

Append the ByteArray in ODBC literal format ({b hexString}).

protected void
appendCalendar(Calendar calendar, Writer writer)

Answer a platform correct string representation of a Calendar as a Timestamp, suitable for SQL generation.

protected void
appendDate(Date date, Writer writer)

Answer a platform correct string representation of a Date, suitable for SQL generation.

public void
appendLiteralToCall(Call call, Writer writer, Object literal, Boolean
- allows higher up the stack (where more context exists) to tell if this literal can be bound
canBind
)

INTERNAL: In case shouldBindLiterals is true, instead of null value a DatabaseField value may be passed (so that it's type could be used for binding null).

protected void
appendLiteralToCallWithBinding(Call call, Writer writer, Object literal)

INTERNAL: Override this method in case the platform needs to do something special for binding literals.

protected void
appendNumber(Number number, Writer writer)

Write number to SQL string.

public void
appendParameter(Call call, Writer writer, Object parameter)

Overrides org.eclipse.persistence.internal.databaseaccess.DatasourcePlatform.appendParameter.

Implements org.eclipse.persistence.internal.databaseaccess.Platform.appendParameter.

Write a database-friendly representation of the given parameter to the writer.
public int
appendParameterInternal(Call call, Writer writer, Object parameter)

Returns the number of parameters that used binding.

protected void
appendString(String string, Writer writer)

Write the string.

protected void
appendTime(Time time, Writer writer)

Answer a platform correct string representation of a Time, suitable for SQL generation.

protected void
appendTimestamp(Timestamp timestamp, Writer writer)

Answer a platform correct string representation of a Timestamp, suitable for SQL generation.

public void
autoCommit(DatabaseAccessor accessor)

Used by JDBC drivers that do not support autocommit so simulate an autocommit.

public void
beginTransaction(DatabaseAccessor accessor)

Used for jdbc drivers which do not support autocommit to explicitly begin a transaction This method is a no-op for databases which implement autocommit as expected.

public Expression
buildBatchCriteria(ExpressionBuilder builder, Expression field)

INTERNAL: Return the selection criteria used to IN batch fetching.

public Expression
buildBatchCriteriaForComplexId(ExpressionBuilder builder, List<Expression> fields)

INTERNAL: Return the selection criteria used to IN batch fetching.

public DatabaseCall
buildCallWithReturning(SQLCall sqlCall, Vector<DatabaseField> returnFields)

INTERNAL Returns null unless the platform supports call with returning

protected Map<String, Class<?>>
buildClassTypes()

Return the mapping of class types to database types for the schema framework.

public String
buildCreateIndex(String
qualified name of the table the index is to be created on
fullTableName
,
String
name of the index
indexName
,
String...
one or more columns the index is created for
columnNames
)

INTERNAL: Don't override this method.

public String
buildCreateIndex(String
qualified name of the table the index is to be created on
fullTableName
,
String
name of the index
indexName
,
String
qualifier to construct qualified name of index if needed
qualifier
,
boolean
Indicates whether unique index is created
isUnique
,
String...
one or more columns the index is created for
columnNames
)

INTERNAL: Override this method with the platform's CREATE INDEX statement.

public String
buildDropIndex(String
qualified name of the table the index is to be removed from
fullTableName
,
String
name of the index
indexName
)

INTERNAL: Don't override this method.

public String
buildDropIndex(String
qualified name of the table the index is to be removed from
fullTableName
,
String
name of the index
indexName
,
String
qualifier to construct qualified name of index if needed
qualifier
)

INTERNAL: Override this method with the platform's DROP INDEX statement.

protected Hashtable<Class<?>, FieldTypeDefinition>
buildFieldTypes()

Return the mapping of class types to database types for the schema framework.

public String
buildProcedureCallString(StoredProcedureCall call, AbstractSession session, AbstractRecord row)

Return the proc syntax for this platform.

public Writer
buildSequenceObjectAlterIncrementWriter(Writer writer, String fullSeqName, int increment)

INTERNAL: Returns sql used to alter sequence object's increment in the database.

public Writer
buildSequenceObjectCreationWriter(Writer writer, String fullSeqName, int increment, int start)

INTERNAL: Returns sql used to create sequence object in the database.

public Writer
buildSequenceObjectDeletionWriter(Writer writer, String fullSeqName)

INTERNAL: Returns sql used to delete sequence object from the database.

public boolean
canBatchWriteWithOptimisticLocking(DatabaseCall call)

INTERNAL: Supports Batch Writing with Optimistic Locking.

public boolean
canBuildCallWithReturning()

INTERNAL Indicates whether the platform can build call with returning.

public boolean

Returns:

value of true if given table exists or false otherwise
checkTableExists
(final DatabaseSessionImpl
current database session
session
,
final TableDefinition
database table meta-data
table
,
final boolean
whether to suppress logging during query execution
suppressLogging
)

INTERNAL: Executes and evaluates query to check whether given table exists.

public void
commitTransaction(DatabaseAccessor accessor)

Used for jdbc drivers which do not support autocommit to explicitly commit a transaction This method is a no-op for databases which implement autocommit as expected.

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.

public Object
convertToDatabaseType(Object value)

INTERNAL We support more primitive than JDBC does so we must do conversion before printing or binding.

public void
public Array

Returns:

Array
createArray
(String elementDataTypeName, Object[] elements, AbstractSession session, Connection connection)

INTERNAL: This method builds an Array using the unwrapped connection within the session

public Array

Returns:

Array
createArray
(String elementDataTypeName, Object[] elements, Connection connection)

INTERNAL: Platforms that support java.sql.Array may override this method.

protected Sequence
public Struct

Returns:

Struct
createStruct
(String structTypeName, Object[] attributes, AbstractSession session, Connection connection)

INTERNAL: This method builds a Struct using the unwrapped connection within the session

public Struct

Returns:

Struct
createStruct
(String structTypeName, Object[] attributes, AbstractRecord row, Vector<DatabaseField> orderedFields, AbstractSession session, Connection connection)

INTERNAL: This method builds a Struct using the unwrapped connection within the session

public Struct

Returns:

Struct
createStruct
(String structTypeName, Object[] attributes, Connection connection)

INTERNAL: Platforms that support java.sql.Struct may override this method.

public boolean
dontBindUpdateAllQueryUsingTempTables()

INTERNAL: May need to override this method if the sql generated for UpdateAllQuery using temp tables fails in case parameter binding is used.

public int

Returns:

- number of rows modified/deleted by this statement
executeBatch
(Statement statement, boolean
- flag is set to true if this statement is prepared
isStatementPrepared
)

Internal: This gets called on each batch statement execution Needs to be implemented so that it returns the number of rows successfully modified by this statement for optimistic locking purposes.

public Object
executeStoredProcedure(DatabaseCall dbCall, PreparedStatement statement, DatabaseAccessor accessor, AbstractSession session)

because each platform has different requirements for accessing stored procedures and the way that we can combine resultsets and output params, the stored procedure call is being executed on the platform.

public void
freeTemporaryObject(Object value)

INTERNAL: Used by some platforms during reading of ResultSet to free temporary objects.

public String
getAssignmentString()

Used for stored function calls.

public String
getBatchBeginString()

Used for batch writing and sp defs.

public String
getBatchDelimiterString()

Used for batch writing and sp defs.

public String
getBatchEndString()

Used for batch writing and sp defs.

public String
getBatchRowCountAssignString()

Used for batch writing for row count return.

public String
getBatchRowCountDeclareString()

Used for batch writing for row count return.

public String
getBatchRowCountReturnString()

Used for batch writing for row count return.

public BatchWritingMechanism
getBatchWritingMechanism()

Return the custom batch writing mechanism.

public int
getCastSizeForVarcharParameter()

ADVANCED: Get the maximum length allowed by the database for a Varchar Parameter This is used by subclasses when writing SQL for parameters

public Map<String, Class<?>>
getClassTypes()

Return the class type to database type mapping for the schema framework.

public Connection
getConnection(AbstractSession session, Connection connection)

INTERNAL: This method is used to unwrap the oracle connection wrapped by the application server.

public String
getConnectionUserName()

INTERNAL: Returns user name retrieved from JDBC connection.

public String
getConstraintDeletionString()

Used for constraint deletion.

public String
getCreateDatabaseSchemaString(String schema)

Return the create schema SQL syntax.

protected String

Returns:

String
getCreateTempTableSqlBodyForTable
(DatabaseTable
is original table for which temp table is created.
table
)

INTERNAL: May override this method if the platform supports temporary tables.

protected String
getCreateTempTableSqlPrefix()

INTERNAL: Override this method if the platform supports temporary tables.

protected String
getCreateTempTableSqlSuffix()

INTERNAL: May override this method if the platform support temporary tables.

public String
getCreateViewString()

/** Used for view creation.

public String
getCreationInOutputProcedureToken()

This method is used to print the required output parameter token for the specific platform.

public String
getCreationOutputProcedureToken()

This method is used to print the required output parameter token for the specific platform.

public int
getCursorCode()

ADVANCED: Return the code for preparing cursored output parameters in a stored procedure

public Object
getCustomModifyValueForCall(Call call, Object value, DatabaseField field, boolean shouldBind)

Overrides org.eclipse.persistence.internal.databaseaccess.DatasourcePlatform.getCustomModifyValueForCall.

Implements org.eclipse.persistence.internal.databaseaccess.Platform.getCustomModifyValueForCall.

This method determines if any special processing needs to occur prior to writing a field.
public String
getDefaultSequenceTableName()

Returns the table name used by TableSequence by default.

public boolean
public String
getDropCascadeString()

Allows DROP TABLE to cascade dropping of any dependent constraints if the database supports this option.

public String
getDropDatabaseSchemaString(String schema)

Return the drop schema SQL syntax.

public FieldTypeDefinition
getFieldTypeDefinition(Class<?> javaClass)

Return the field type object describing this databases platform specific representation of the Java primitive class name.

public Map<Class<?>, FieldTypeDefinition>
getFieldTypes()

Return the class type to database type mappings for the schema framework.

public String
getFunctionCallHeader()

Used for stored function calls.

public String
getIndexNamePrefix(boolean isUniqueSetOnField)

Used to allow platforms to define their own index prefixes

public String
getInOutputProcedureToken()

This method is used to print the output parameter token when stored procedures are called

public String
getInputProcedureToken()

Used for stored procedure creation: Prefix for INPUT parameters.

public String
getJDBCOuterJoinString()

Returns the JDBC outer join operator for SELECT statements.

public int
getJDBCType(DatabaseField field)

Return the JDBC type for the given database field.

public int
getJDBCType(Class<?> javaType)

Return the JDBC type for the Java type.

public int
getJDBCTypeForSetNull(DatabaseField field)

Return the JDBC type for the given database field to be passed to Statement.setNull

public String
getJdbcTypeName(int jdbcType)

INTERNAL: Returns the type name corresponding to the jdbc type

public DatabaseJsonPlatform

Returns:

JSON support extension instance
getJsonPlatform
()

Get JSON support extension instance.

public int
getMaxBatchWritingSize()

PUBLIC: Allow for the max batch writing size to be set.

public int
getMaxFieldNameSize()

INTERNAL: returns the maximum number of characters that can be used in a field name on this platform.

public int
getMaxForeignKeyNameSize()

INTERNAL: returns the maximum number of characters that can be used in a foreign key name on this platform.

public int
getMaxIndexNameSize()

INTERNAL: returns the maximum number of characters that can be used in an index name on this platform.

public int
getMaxUniqueKeyNameSize()

INTERNAL: returns the maximum number of characters that can be used in a unique key name on this platform.

public String
getNoWaitString()

This syntax does no wait on the lock.

public Object
getObjectFromResultSet(ResultSet resultSet, int columnNumber, int type, AbstractSession session)

INTERNAL: Get the object from the JDBC Result set.

public String
getOutputProcedureToken()

This method is used to print the output parameter token when stored procedures are called

public Object
getParameterValueFromDatabaseCall(CallableStatement statement, int
- 1-based index in the argument list
index
,
AbstractSession session)

INTERNAL Get the parameter from the JDBC statement with the given index.

public Object
getParameterValueFromDatabaseCall(CallableStatement statement, String name, AbstractSession session)

INTERNAL Get the parameter from the JDBC statement with the given name.

public DataPartitioningCallback
getPartitioningCallback()

Return callback.

public String
getPingSQL()

Used for determining if an SQL exception was communication based.

public String
getProcedureArgument(String name, Object parameter, DatasourceCall.ParameterType parameterType, StoredProcedureCall call, AbstractSession session)

Obtain the platform specific argument string

public String
getProcedureArgumentString()

Used for sp defs.

public String
getProcedureAsString()

Used for stored procedure defs.

public String
getProcedureBeginString()

Used for stored procedure defs.

public String
getProcedureCallHeader()

Used for sp calls.

public String
getProcedureCallTail()

Used for sp calls.

public String
getProcedureEndString()

Used for stored procedure defs.

public String
getProcedureOptionList()

Some platforms have an option list Only to be used for stored procedure creation.

public String
public String
public Object

Returns:

Object
getRefValue
(Ref ref, Connection connection)

INTERNAL: Platforms that support java.sql.Ref may override this method.

public Object

Returns:

Object
getRefValue
(Ref ref, AbstractSession executionSession, Connection connection)

INTERNAL: This method builds a REF using the unwrapped connection within the session

public String
getSelectForUpdateNoWaitString()

This syntax does no wait on the lock.

public String
getSelectForUpdateOfString()

For fine-grained pessimistic locking the column names can be specified individually.

public String
getSelectForUpdateString()

Most database support a syntax.

public String
getSelectForUpdateWaitString(Integer waitTimeout)

Platforms that support the WAIT option should override this method.

public String
public String
public int
public String
public int
getStatementCacheSize()

The statement cache size for prepare parameterized statements.

public String
public String
getStoredProcedureTerminationToken()

Returns the delimiter between stored procedures in multiple stored procedure calls.

public int
public Map<String, StructConverter>
getStructConverters()

INTERNAL: Get the map of StructConverters that will be used to preprocess STRUCT data as it is read

public String
getTableCreationSuffix()

PUBLIC: Get the String used on all table creation statements generated from the DefaultTableGenerator with a session using this project (DDL generation).

protected DataReadQuery

Returns:

query to check whether given table exists
getTableExistsQuery
(final TableDefinition
database table meta-data
table
)

INTERNAL: Returns query to check whether given table exists.

public DatabaseTable

Returns:

temporary table
getTempTableForTable
(DatabaseTable
is original table for which temp table is created.
table
)

INTERNAL: May override this method if the platform support temporary tables.

public int
getTransactionIsolation()

Returns the transaction isolation setting for a connection.

public Map<Class<?>, StructConverter>
getTypeConverters()

INTERNAL: Get the map of TypeConverters This map indexes StructConverters by the Java Class they are meant to convert

public String
getUniqueConstraintDeletionString()

Used for constraint deletion.

public boolean
public DatabaseQuery
getVPDClearIdentifierQuery(String vpdIdentifier)

Any platform that supports VPD should implement this method.

public String
getVPDCreationFunctionString(String tableName, String tenantFieldName)

Any platform that supports VPD should implement this method.

public String
getVPDCreationPolicyString(String tableName, AbstractSession session)

Any platform that supports VPD should implement this method.

public String
getVPDDeletionString(String tableName, AbstractSession session)

Any platform that supports VPD should implement this method.

public DatabaseQuery
getVPDSetIdentifierQuery(String vpdIdentifier)

Any platform that supports VPD should implement this method.

public boolean
hasPartitioningCallback()

Check if has callback.

public void
public void
initializeConnectionData(Connection connection)

INTERNAL: Allow initialization from the connection.

public 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.

public boolean
isCastRequired()

Return if casting is enabled for platforms that support it.

public boolean
isDynamicSQLRequiredForFunctions()

INTERNAL: Some databases have issues with using parameters on certain functions and relations.

public boolean
isForUpdateCompatibleWithDistinct()

INTERNAL: Indicates whether SELECT DISTINCT ...

public boolean
isInformixOuterJoin()

Some database require outer joins to be given in the where clause, others require it in the from clause.

public boolean
isJDBCExecuteCompliant()

Returns true if this platform complies with the expected behavior from a jdbc execute call.

public boolean
isLobCompatibleWithDistinct()

INTERNAL: Indicates whether SELECT DISTINCT lob FROM ...

public boolean
isLockTimeoutException(DatabaseException e)

Return true is the given exception occurred as a result of a lock time out exception (WAIT clause).

public boolean
isNullAllowedInSelectClause()

INTERNAL: Override this if the platform cannot handle NULL in select clause.

public boolean
isOutputAllowWithResultSet()

INTERNAL: Return true if output parameters can be built with result sets.

public boolean
isRowCountOutputParameterRequired()

Return if the platform does not maintain the row count on batch executes and requires an output parameter to maintain the row count.

public boolean

Returns:

String
isXDBDocument
(Object obj)

INTERNAL: Indicates whether the passed object is an instance of XDBDocument.

public Hashtable<Class<? extends Number>, ? super Number>
maximumNumericValues()

Builds a table of maximum numeric values keyed on java class.

public Hashtable<Class<? extends Number>, ? super Number>
minimumNumericValues()

Builds a table of minimum numeric values keyed on java class.

public long
minimumTimeIncrement()

INTERNAL: Returns the minimum time increment supported by the platform.

public Statement

Returns:

statement to be used for batch writing
prepareBatchStatement
(Statement statement, int maxBatchWritingSize)

Internal: Allows setting the batch size on the statement Is used with parameterized SQL, and should only be passed in prepared statements

public void
printFieldIdentityClause(Writer writer)

Append the receiver's field 'identity' constraint clause to a writer.

public void
printFieldNotNullClause(Writer writer)

Append the receiver's field 'NOT NULL' constraint clause to a writer.

public void
printFieldNullClause(Writer writer)

Append the receiver's field 'NULL' constraint clause to a writer.

public void
printFieldTypeSize(Writer writer, FieldDefinition field, FieldTypeDefinition fieldType, boolean shouldPrintFieldIdentityClause)

protected void
public void
printFieldUnique(Writer writer, boolean shouldPrintFieldIdentityClause)

protected void
public void
printSQLSelectStatement(DatabaseCall call, ExpressionSQLPrinter printer, SQLSelectStatement statement)

INTERNAL: Print the SQL representation of the statement on a stream, storing the fields in the DatabaseCall.

public void
printStoredFunctionReturnKeyWord(Writer writer)

INTERNAL: Prints return keyword for StoredFunctionDefinition: CREATE FUNCTION StoredFunction_In (P_IN BIGINT) RETURN BIGINT The method was introduced because MySQL requires "RETURNS" instead: CREATE FUNCTION StoredFunction_In (P_IN BIGINT) RETURNS BIGINT

public int
printValuelist(int[] theObjects, DatabaseCall call, Writer writer)

Print the int array on the writer.

public int
printValuelist(Collection<?> theObjects, DatabaseCall call, Writer writer)

public void
registerOutputParameter(CallableStatement statement, int parameterIndex, int sqlType)

This method is used to register output parameter on CallableStatements for Stored Procedures as each database seems to have a different method.

public void
registerOutputParameter(CallableStatement statement, int parameterIndex, int sqlType, String typeName)

This method is used to register output parameter on CallableStatements for Stored Procedures as each database seems to have a different method.

public void
registerOutputParameter(CallableStatement statement, String parameterName, int sqlType)

This method is used to register output parameter on CallableStatements for Stored Procedures as each database seems to have a different method.

public void
registerOutputParameter(CallableStatement statement, String parameterName, int sqlType, String typeName)

This method is used to register output parameter on CallableStatements for Stored Procedures as each database seems to have a different method.

public boolean
requiresNamedPrimaryKeyConstraints()

This is used as some databases create the primary key constraint differently, i.e. Access.

public boolean
requiresProcedureBrackets()

Used for stored procedure creation: Some platforms need brackets around arguments declaration even if no arguments exist.

public boolean
requiresProcedureCallBrackets()

USed for sp calls.

public boolean
requiresProcedureCallOuputToken()

Used for sp calls.

public boolean
requiresTableInIndexDropDDL()

INTERNAL: Return if this database requires the table name when dropping an index.

public boolean
requiresTypeNameToRegisterOutputParameter()

INTERNAL: Indicates whether the version of CallableStatement.registerOutputParameter method that takes type name should be used.

public boolean

Returns:

whether unique constraints should be declared as part of the CREATE TABLE statement instead of in separate ALTER TABLE ADD/DROP statements.
requiresUniqueConstraintCreationOnTableCreate
()

Used for table creation.

public void
retrieveFirstPrimaryKeyOrOne(ReportQuery subselect)

INTERNAL: Used by Exists queries because they just need to select a single row.

public void
rollbackTransaction(DatabaseAccessor accessor)

Used for jdbc drivers which do not support autocommit to explicitly rollback a transaction This method is a no-op for databases which implement autocommit as expected.

public void
setBatchWritingMechanism(BatchWritingMechanism batchWritingMechanism)

Set the custom batch writing mechanism.

public void
setCastSizeForVarcharParameter(int maxLength)

ADVANCED: Set the maximum length allowed by the database for a Varchar Parameter This is used by subclasses when writing SQL for parameters

protected void
setClassTypes(Map<String, Class<?>> classTypes)

public void
setCursorCode(int cursorCode)

ADVANCED: Set the code for preparing cursored output parameters in a stored procedure

public void
setDriverName(String driverName)

During auto-detect, the driver name is set on the platform.

public void
protected void
public void
setIsCastRequired(boolean isCastRequired)

Set if casting is enabled for platforms that support it.

public void
setMaxBatchWritingSize(int maxBatchWritingSize)

PUBLIC: Allow for the max batch writing size to be set.

protected void
setNullFromDatabaseField(DatabaseField databaseField, PreparedStatement statement, int index)

protected void
public void
setParameterValueInDatabaseCall(Object parameter, PreparedStatement statement, int index, AbstractSession session)

INTERNAL Set the parameter in the JDBC statement at the given index.

public void
setParameterValueInDatabaseCall(Object parameter, CallableStatement statement, String name, AbstractSession session)

INTERNAL Set the parameter in the JDBC statement with the given name.

public void
setPartitioningCallback(DataPartitioningCallback partitioningCallback)

Set callback.

public void
setPingSQL(String pingSQL)

Used for determining if an SQL exception was communication based.

public void
setPrintInnerJoinInWhereClause(boolean printInnerJoinInWhereClause)

PUBLIC: Changes the way that inner joins are printed in generated SQL for the database.

public void
setPrintOuterJoinInWhereClause(boolean printOuterJoinInWhereClause)

PUBLIC: Changes the way that OuterJoins are done on the database.

public void
public void
public void
public void
setShouldBindAllParameters(boolean shouldBindAllParameters)

Bind all arguments to any SQL statement.

public void
setShouldBindLiterals(boolean shouldBindLiterals)

PUBLIC: Allows user to choose whether to bind literals in DatabaseCalls or not.

public void
setShouldBindPartialParameters(boolean shouldBindPartialParameters)

Used to enable parameter binding and override the platform default

public void
setShouldCacheAllStatements(boolean shouldCacheAllStatements)

Cache all prepared statements, this requires full parameter binding as well.

public void
setShouldCreateIndicesOnForeignKeys(boolean shouldCreateIndicesOnForeignKeys)

Used for table creation.

public void
setShouldForceBindAllParameters(boolean shouldForceBindAllParameters)

Used to enable parameter binding and override the platform default

public void
setShouldForceFieldNamesToUpperCase(boolean shouldForceFieldNamesToUpperCase)

Can be used if the app expects upper case but the database is not return consistent case, i.e. different databases.

public static void
setShouldIgnoreCaseOnFieldComparisons(boolean newShouldIgnoreCaseOnFieldComparisons)

Allow for case in field names to be ignored as some databases are not case sensitive and when using custom this can be an issue.

public void
setShouldOptimizeDataConversion(boolean value)

PUBLIC: Set if our driver level data conversion optimization is enabled.

public void
setShouldTrimStrings(boolean aBoolean)

public void
setShouldUseRownumFiltering(boolean useRownumFiltering)

PUBLIC: Set if SQL-Level pagination should be used for FirstResult and MaxRows settings.

public void
setStatementCacheSize(int statementCacheSize)

The statement cache size for prepare parameterized statements.

public void
setStoredProcedureTerminationToken(String storedProcedureTerminationToken)

public void
public void
setSupportsAutoCommit(boolean supportsAutoCommit)

supportsAutoCommit can be set to false for JDBC drivers which do not support autocommit.

public void
setTableCreationSuffix(String tableCreationSuffix)

PUBLIC: Get the String used on all table creation statements generated from the DefaultTableGenerator with a session using this project (DDL generation).

public void
setTransactionIsolation(int isolationLevel)

Set the transaction isolation setting for a connection.

public void
setUseJDBCStoredProcedureSyntax(Boolean useJDBCStoredProcedureSyntax)

Return true if JDBC syntax should be used for stored procedure calls.

public void
public void
setUsesBatchWriting(boolean usesBatchWriting)

public void
setUsesByteArrayBinding(boolean usesByteArrayBinding)

public void
setUsesJDBCBatchWriting(boolean usesJDBCBatchWriting)

Some JDBC 2 drivers to not support batching, so this lets are own batching be used.

public void
setUsesNativeBatchWriting(boolean
- flag to turn on/off native batch writing
usesNativeBatchWriting
)

Advanced: This is used to enable native batch writing on drivers that support it.

public void
setUsesNativeSQL(boolean usesNativeSQL)

public void
setUsesStreamsForBinding(boolean usesStreamsForBinding)

public void
setUsesStringBinding(boolean aBool)

public boolean
shouldAlwaysUseTempStorageForModifyAll()

INTERNAL: That method affects UpdateAllQuery and DeleteAllQuery execution.

public boolean
shouldBindAllParameters()

Bind all arguments to any SQL statement.

public boolean
shouldBindLiterals()

PUBLIC: Allows platform to choose whether to bind literals in DatabaseCalls or not.

public boolean
shouldBindPartialParameters()

Used to determine if the platform should perform partial parameter binding or not

Off by default.

public boolean
shouldCacheAllStatements()

Cache all prepared statements, this requires full parameter binding as well.

public boolean

Returns:

whether an index should be created explicitly for primary keys
shouldCreateIndicesForPrimaryKeys
()

Used for table creation.

public boolean

Returns:

whether an index should be created explicitly for foreign key constraints
shouldCreateIndicesOnForeignKeys
()

Used for table creation.

public boolean

Returns:

whether an index should be created explicitly for unique constraints
shouldCreateIndicesOnUniqueKeys
()

Used for table creation.

public boolean
shouldForceBindAllParameters()

Used to enable parameter binding and override platform default

public boolean
shouldForceFieldNamesToUpperCase()

Can be used if the app expects upper case but the database is not return consistent case, i.e. different databases.

public static boolean
shouldIgnoreCaseOnFieldComparisons()

Allow for case in field names to be ignored as some databases are not case sensitive and when using custom this can be an issue.

public boolean
shouldIgnoreException(SQLException exception)

Allow for the platform to ignore exceptions.

public boolean
shouldOptimizeDataConversion()

Return if our driver level data conversion optimization is enabled.

public boolean
shouldPrintAliasForUpdate()

INTERNAL: Indicates whether locking OF clause should print alias for field.

public boolean
shouldPrintConstraintNameAfter()

Some Platforms want the constraint name after the constraint definition.

public boolean
public boolean
public boolean
shouldPrintInnerJoinInWhereClause(ReadQuery query)

This allows which clause inner joins are printed into in SQL generation.

public boolean
shouldPrintInOutputTokenBeforeType()

This is required in the construction of the stored procedures with output parameters

public boolean
shouldPrintInputTokenAtStart()

Used for stored procedure creation: Some platforms want to print prefix for INPUT arguments BEFORE NAME.

public boolean
shouldPrintLockingClauseAfterWhereClause()

INTERNAL: Indicates whether locking clause should be printed after where clause by SQLSelectStatement.

public boolean
shouldPrintOuterJoinInWhereClause()

Some database require outer joins to be given in the where clause, others require it in the from clause.

public boolean
shouldPrintOutputTokenAtStart()

This is required in the construction of the stored procedures with output parameters

public boolean
shouldPrintOutputTokenBeforeType()

This is required in the construction of the stored procedures with output parameters

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 = ?)

public boolean
shouldPrintStoredProcedureVariablesAfterBeginString()

Used for stored procedure creation: Some platforms declare variables AFTER the procedure body's BEGIN string.

protected boolean
shouldTempTableSpecifyPrimaryKeys()

INTERNAL: Indicates whether temporary table can specify primary keys (some platforms don't allow that).

public boolean
public boolean
shouldUseCustomModifyForCall(DatabaseField field)

Overrides org.eclipse.persistence.internal.databaseaccess.DatasourcePlatform.shouldUseCustomModifyForCall.

Implements org.eclipse.persistence.internal.databaseaccess.Platform.shouldUseCustomModifyForCall.

Used by SQLCall.appendModify(..) If the field should be passed to customModifyInDatabaseCall, retun true, otherwise false.
public boolean
shouldUseGetSetNString()

Returns true iff:

  • tThe current driver supports calling get/setNString
  • Strings are globally mapped to a national character varying type (useNationalCharacterVarying()).
public boolean
shouldUseJDBCOuterJoinSyntax()

JDBC defines and outer join syntax, many drivers do not support this.

public boolean
shouldUseRownumFiltering()

PUBLIC: Return if Oracle ROWNUM pagination should be used for FirstResult and MaxRows settings.

public boolean
supportsANSIInnerJoinSyntax()

Indicates whether the ANSI syntax for inner joins (e.g. SELECT FROM t1 JOIN t2 ON t1.pk = t2.fk) is supported by this platform.

public boolean
supportsAutoCommit()

supportsAutoCommit must sometimes be set to false for JDBC drivers which do not support autocommit.

public boolean
supportsAutoConversionToNumericForArithmeticOperations()

Some db allow VARCHAR db field to be used in arithmetic operations automatically converting them to numeric: UPDATE OL_PHONE SET PHONE_ORDER_VARCHAR = (PHONE_ORDER_VARCHAR + 1) WHERE ...

public boolean

Returns:

Always returns false
supportsConnectionUserName
()

INTERNAL: Override this method if the platform supports storing JDBC connection user name during initializeConnectionData(Connection).

public boolean
supportsCountDistinctWithMultipleFields()

INTERNAL: Indicates whether the platform supports the count distinct function with multiple fields.

public boolean
public boolean
public boolean
supportsGlobalTempTables()

INTERNAL: Indicates whether the platform supports global temporary tables.

public boolean
supportsIndexes()

INTERNAL: Return if this database support index creation.

public boolean
supportsIndividualTableLocking()

INTERNAL: Indicates whether locking clause could be selectively applied only to some tables in a ReadQuery.

public boolean
supportsLocalTempTables()

INTERNAL: Indicates whether the platform supports local temporary tables.

public boolean
supportsLockingQueriesWithMultipleTables()

INTERNAL: Indicates whether locking clause could be applied to the query that has more than one table

public boolean
supportsNestingOuterJoins()

INTERNAL: Return if nesting outer joins is supported, i.e. each join must be followed by the ON clause.

public boolean
supportsOrderByParameters()

Used to determine if the platform supports untyped parameters, as ordinal variables, within the Order By clause

On by default.

public boolean
supportsOuterJoinsWithBrackets()

INTERNAL: Return if brackets can be used in the ON clause for outer joins.

public boolean
public boolean
public boolean
supportsTempTables()

INTERNAL: Indicates whether the platform supports temporary tables.

public boolean
supportsUniqueColumns()

Allows unique columns to be defined as constraint if the UNIQUE keyword is not support on a column defintion.

public boolean
public boolean
supportsVPD()

By default, platforms do not support VPD.

public boolean
supportsWaitForUpdate()

INTERNAL: Indicates whether the platform supports timeouts on For Update

public boolean
public boolean
public boolean
usesJDBCBatchWriting()

Some JDBC 2 drivers to not support batching, so this lets are own batching be used.

public boolean
public boolean
public boolean
public boolean
public boolean
public boolean
wasFailureCommunicationBased(SQLException exception, Connection connection, AbstractSession sessionForProfile)

public void
writeAddColumnClause(Writer writer, AbstractSession session, TableDefinition table, FieldDefinition field)

INTERNAL: May need to override this method if the platform supports ALTER TABLE ADD <column> and the generated sql doesn't work.

protected static void
writeAutoAssignmentSetClause(Writer writer, String tableName1, String tableName2, Collection<DatabaseField> fields, DatasourcePlatform platform)

INTERNAL: helper method, don't override.

protected static void
writeAutoJoinWhereClause(Writer writer, String tableName1, String tableName2, Collection<DatabaseField> pkFields, DatasourcePlatform platform)

INTERNAL: helper method, don't override.

public void
writeCleanUpTempTableSql(Writer
for writing the sql
writer
,
DatabaseTable
is original table for which temp table is created.
table
)

INTERNAL: Don't override this method.

public void
writeCreateTempTableSql(Writer
for writing the sql
writer
,
DatabaseTable
is original table for which temp table is created.
table
,
AbstractSession session, Collection<DatabaseField>
primary key fields for the original table.
pkFields
,
Collection<DatabaseField>
fields that will be used by operation for which temp table is created.
usedFields
,
Collection<DatabaseField>
all mapped fields for the original table.
allFields
)

INTERNAL: Don't override this method.

public void
writeDeleteFromTargetTableUsingTempTableSql(Writer
for writing the sql
writer
,
DatabaseTable
is original table for which temp table is created.
table
,
DatabaseTable
is a table from which to delete.
targetTable
,
Collection<DatabaseField>
primary key fields for the original table.
pkFields
,
Collection<DatabaseField>
primary key fields for the target table.
targetPkFields
,
DatasourcePlatform platform)

INTERNAL: Write an sql string for deletion from target table using temporary table.

protected static void
writeFields(Writer writer, String tableName1, String tableName2, Collection<DatabaseField> fields1, Collection<DatabaseField> fields2, String separator, DatasourcePlatform platform)

INTERNAL: helper method, don't override.

protected static void
writeFieldsAutoClause(Writer writer, String tableName1, String tableName2, Collection<DatabaseField> fields, String separator, DatasourcePlatform platform)

INTERNAL: helper method, don't override.

protected static void
writeFieldsList(Writer writer, Collection<DatabaseField> fields, DatasourcePlatform platform)

INTERNAL: helper method, don't override.

public void
writeInsertIntoTableSql(Writer
for writing the sql
writer
,
DatabaseTable
is original table for which temp table is created.
table
,
Collection<DatabaseField>
fields that will be used by operation for which temp table is created.
usedFields
)

INTERNAL: May need to override this method if the platform supports temporary tables and the generated sql doesn't work.

protected static void
writeJoinWhereClause(Writer writer, String tableName1, String tableName2, Collection<DatabaseField> pkFields1, Collection<DatabaseField> pkFields2, DatasourcePlatform platform)

INTERNAL: helper method, don't override.

public void
writeLOB(DatabaseField field, Object value, ResultSet resultSet, AbstractSession session)

INTERNAL: Write LOB value - only on Oracle8 and up

public void
public void
writeTableCreationSuffix(Writer writer, String tableCreationSuffix)

INTERNAL: Write used on all table creation statements generated from the DefaultTableGenerator with a session using this project (DDL generation).

public void
writeUpdateOriginalFromTempTableSql(Writer
for writing the sql
writer
,
DatabaseTable
is original table for which temp table is created.
table
,
Collection<DatabaseField>
primary key fields for the original table.
pkFields
,
Collection<DatabaseField>
fields to be assigned a new value.
assignedFields
)

INTERNAL: May need to override this method if the platform supports temporary tables and the generated sql doesn't work.

Inherited from org.eclipse.persistence.internal.databaseaccess.DatasourcePlatform:
addOperatoraddSequenceaddSequencebuildNativeCallbuildSelectQueryForIdentitybuildSelectQueryForIdentitybuildSelectQueryForSequenceObjectbuildSelectQueryForSequenceObjectcloneconvertObjectcreateConnectionCustomizercreateExpressionForgetConversionManagergetDataTypesConvertedFromgetDataTypesConvertedTogetDefaultNativeSequenceToTablegetDefaultSeqenceAtNextValuegetDefaultSequencegetDefaultSequenceToWritegetDriverVersiongetEndDelimitergetINClauseLimitgetOperatorgetPlatformOperatorsgetSelectSequenceQuerygetSequencegetSequencesgetSequencesToWritegetStartDelimitergetTableQualifiergetTimestampFromServergetTimestampQuerygetUpdateSequenceQuerygetUUIDQueryhasDefaultSequenceinitializeDefaultQueriesinitializePlatformOperatorsinitIdentitySequencesisAccessisAttunityisCloudscapeisDB2isDB2ZisDBaseisDerbyisFirebirdisH2isHANAisHSQLisInformixisMariaDBisMaxDBisMySQLisODBCisOracleisOracle12isOracle23isOracle9isPervasiveisPointBaseisPostgreSQLisSQLAnywhereisSQLServerisSybaseisSymfowareisTimesTenisTimesTen7removeAllSequencesremoveIdentitySequencesremoveSequencesequencesAfterCloneCleanupsetConversionManagersetDefaultNativeSequenceToTablesetDefaultSeqenceAtNextValuesetDefaultSequencesetEndDelimitersetSelectSequenceNumberQuerysetSequencePreallocationSizesetSequencessetStartDelimitersetSupportsReturnGeneratedKeyssetTableQualifiersetTimestampQuerysetUpdateSequenceQuerysetUUIDQueryshouldNativeSequenceUseTransactionshouldPrepareshouldSelectDistinctIncludeOrderByshouldSelectIncludeOrderBysupportsIdentitysupportsNativeSequenceNumberssupportsReturnGeneratedKeyssupportsSequenceObjectstoStringusesPlatformDefaultSequence