Top Description Fields Constructors Methods
org.eclipse.persistence.platform.database

public final Class MaxDBPlatform

extends DatabasePlatform
Class Inheritance
Annotations
@SuppressWarnings:serial
Imports
java.io.IOException, .Writer, java.math.BigDecimal, .BigInteger, java.sql.Blob, .Clob, .Date, .Time, .Timestamp, java.util.ArrayList, .Hashtable, .List, org.eclipse.persistence.expressions.ExpressionOperator, .ListExpressionOperator, org.eclipse.persistence.internal.databaseaccess.DatabaseCall, .FieldTypeDefinition, org.eclipse.persistence.internal.helper.ClassConstants, .DatabaseTable, org.eclipse.persistence.queries.ValueReadQuery, org.eclipse.persistence.tools.schemaframework.FieldDefinition

Database Platform for SAP MaxDB.

Wiki page

Usage

The MaxDB platform is configured in the persistence.xml by the following property:

<property name="eclipselink.target-database" value="MaxDB"/>

Forward mapping with EclipseLink assumes that MaxDB is configured for unicode (in version 7.7, this is the default). Unicode mode also needs to be specified in the URL as follows:

jdbc:sapdb://localhost/E32?unicode=yes

Tested with:

Limitations:

Authors
Markus KARG (markus at headcrashing.eu), afischbach, agoerler, Sabine Heider (sabine.heider at sap.com), Konstantin Schwed (konstantin.schwed at sap.com)

Field Summary

Modifier and TypeField and Description
private static final FieldTypeDefinition
private static final FieldTypeDefinition
private static final int
MAX_VARCHAR_UNICODE_LENGTH

Maximum length of type VARCHAR UNICODE (link)

Inherited from org.eclipse.persistence.platform.database.DatabasePlatform:
DEFAULT_VARCHAR_SIZE

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
protected Hashtable<Class<?>, FieldTypeDefinition>
buildFieldTypes()

Overrides org.eclipse.persistence.internal.databaseaccess.DatabasePlatform.buildFieldTypes.

Return the mapping of class types to database types for the schema framework.
public ValueReadQuery
buildSelectQueryForSequenceObject(final String sequenceName, final Integer size)

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

INTERNAL: Returns query used to read value generated by sequence object (like Oracle sequence).
public boolean
private static ExpressionOperator
private static ExpressionOperator
private static ExpressionOperator

Returns:

the expression operator representing the JPQL function current_date as defined by 4.6.17.2.3 of the JPA 2.0 specification
createCurrentDateExpressionOperator
()

Creates the expression operator representing the JPQL function current_date as defined by 4.6.17.2.3 of the JPA 2.0 specification

private static ExpressionOperator

Returns:

the expression operator representing the JPQL function current_timestamp as defined by 4.6.17.2.3 of the JPA 2.0 specification
createCurrentTimeExpressionOperator
()

Creates the expression operator representing the JPQL function current_timestamp as defined by 4.6.17.2.3 of the JPA 2.0 specification

private static ExpressionOperator
private static ExpressionOperator
private static ExpressionOperator

Returns:

the expression operator representing the JPQL function current_timestamp as defined by 4.6.17.2.3 of the JPA 2.0 specification
createTodayExpressionOperator
()

Creates the expression operator representing the JPQL function current_timestamp as defined by 4.6.17.2.3 of the JPA 2.0 specification

private static ExpressionOperator
private static ExpressionOperator
protected String
getCreateTempTableSqlPrefix()

Overrides org.eclipse.persistence.internal.databaseaccess.DatabasePlatform.getCreateTempTableSqlPrefix.

INTERNAL: Override this method if the platform supports temporary tables.
public int
getMaxFieldNameSize()

Overrides org.eclipse.persistence.internal.databaseaccess.DatabasePlatform.getMaxFieldNameSize.

INTERNAL: returns the maximum number of characters that can be used in a field name on this platform.
public String
public String
public DatabaseTable
getTempTableForTable(final DatabaseTable
is original table for which temp table is created.
table
)

Overrides org.eclipse.persistence.internal.databaseaccess.DatabasePlatform.getTempTableForTable.

INTERNAL: May override this method if the platform support temporary tables.
protected void
public boolean
public boolean
protected void
public boolean
public boolean
shouldBindLiterals()

Overrides org.eclipse.persistence.internal.databaseaccess.DatabasePlatform.shouldBindLiterals.

PUBLIC: Allows platform to choose whether to bind literals in DatabaseCalls or not.
public boolean
shouldOptimizeDataConversion()

Overrides org.eclipse.persistence.internal.databaseaccess.DatabasePlatform.shouldOptimizeDataConversion.

Return if our driver level data conversion optimization is enabled.
public boolean
shouldPrintOuterJoinInWhereClause()

Overrides org.eclipse.persistence.internal.databaseaccess.DatabasePlatform.shouldPrintOuterJoinInWhereClause.

Some database require outer joins to be given in the where clause, others require it in the from clause.
public boolean
shouldUseJDBCOuterJoinSyntax()

Overrides org.eclipse.persistence.internal.databaseaccess.DatabasePlatform.shouldUseJDBCOuterJoinSyntax.

JDBC defines and outer join syntax, many drivers do not support this.
public boolean
supportsIndividualTableLocking()

Overrides org.eclipse.persistence.internal.databaseaccess.DatabasePlatform.supportsIndividualTableLocking.

INTERNAL: Indicates whether locking clause could be selectively applied only to some tables in a ReadQuery.
public boolean
supportsLocalTempTables()

Overrides org.eclipse.persistence.internal.databaseaccess.DatabasePlatform.supportsLocalTempTables.

INTERNAL: Indicates whether the platform supports local temporary tables.
public boolean
public boolean
supportsSequenceObjects()

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

INTERNAL: Indicates whether the platform supports sequence objects.
public boolean

Field Detail

FIELD_TYPE_DEFINITION_BLOBback to summary
private static final FieldTypeDefinition FIELD_TYPE_DEFINITION_BLOB
FIELD_TYPE_DEFINITION_CLOBback to summary
private static final FieldTypeDefinition FIELD_TYPE_DEFINITION_CLOB
MAX_VARCHAR_UNICODE_LENGTHback to summary
private static final int MAX_VARCHAR_UNICODE_LENGTH

Maximum length of type VARCHAR UNICODE (link)

Constructor Detail

MaxDBPlatformback to summary
public MaxDBPlatform()

Method Detail

buildFieldTypesback to summary
protected Hashtable<Class<?>, FieldTypeDefinition> buildFieldTypes()

Overrides org.eclipse.persistence.internal.databaseaccess.DatabasePlatform.buildFieldTypes.

Doc from org.eclipse.persistence.internal.databaseaccess.DatabasePlatform.buildFieldTypes.

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

Annotations
@Override
buildSelectQueryForSequenceObjectback to summary
public ValueReadQuery buildSelectQueryForSequenceObject(final String sequenceName, final Integer size)

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

Doc from org.eclipse.persistence.internal.databaseaccess.DatasourcePlatform.buildSelectQueryForSequenceObject.

INTERNAL: Returns query used to read value generated by sequence object (like Oracle sequence). In case the other version of this method (taking no parameters) returns null, this method is called every time sequence object NativeSequence reads. If the platform supportsSequenceObjects then (at least) one of buildSelectQueryForSequenceObject methods should return non-null query.

Annotations
@Override
canBatchWriteWithOptimisticLockingback to summary
public boolean canBatchWriteWithOptimisticLocking(DatabaseCall call)

Overrides org.eclipse.persistence.internal.databaseaccess.DatabasePlatform.canBatchWriteWithOptimisticLocking.

Doc from org.eclipse.persistence.internal.databaseaccess.DatabasePlatform.canBatchWriteWithOptimisticLocking.

INTERNAL: Supports Batch Writing with Optimistic Locking.

Annotations
@Override
createCoalesceOperatorback to summary
private static ExpressionOperator createCoalesceOperator()
createConcatExpressionOperatorback to summary
private static ExpressionOperator createConcatExpressionOperator()
createCurrentDateExpressionOperatorback to summary
private static ExpressionOperator createCurrentDateExpressionOperator()

Creates the expression operator representing the JPQL function current_date as defined by 4.6.17.2.3 of the JPA 2.0 specification

Returns:ExpressionOperator

the expression operator representing the JPQL function current_date as defined by 4.6.17.2.3 of the JPA 2.0 specification

createCurrentTimeExpressionOperatorback to summary
private static ExpressionOperator createCurrentTimeExpressionOperator()

Creates the expression operator representing the JPQL function current_timestamp as defined by 4.6.17.2.3 of the JPA 2.0 specification

Returns:ExpressionOperator

the expression operator representing the JPQL function current_timestamp as defined by 4.6.17.2.3 of the JPA 2.0 specification

createNullifOperatorback to summary
private static ExpressionOperator createNullifOperator()
createNullValueOperatorback to summary
private static ExpressionOperator createNullValueOperator()
createTodayExpressionOperatorback to summary
private static ExpressionOperator createTodayExpressionOperator()

Creates the expression operator representing the JPQL function current_timestamp as defined by 4.6.17.2.3 of the JPA 2.0 specification

Returns:ExpressionOperator

the expression operator representing the JPQL function current_timestamp as defined by 4.6.17.2.3 of the JPA 2.0 specification

createToNumberOperatorback to summary
private static ExpressionOperator createToNumberOperator()
createTrim2ExpressionOperatorback to summary
private static ExpressionOperator createTrim2ExpressionOperator()
getCreateTempTableSqlPrefixback to summary
protected String getCreateTempTableSqlPrefix()

Overrides org.eclipse.persistence.internal.databaseaccess.DatabasePlatform.getCreateTempTableSqlPrefix.

Doc from org.eclipse.persistence.internal.databaseaccess.DatabasePlatform.getCreateTempTableSqlPrefix.

INTERNAL: Override this method if the platform supports temporary tables. This should contain the beginning of sql string for creating temporary table - the sql statement name, for instance: "CREATE GLOBAL TEMPORARY TABLE ". Don't forget to end it with a space.

Annotations
@Override
getMaxFieldNameSizeback to summary
public int getMaxFieldNameSize()

Overrides org.eclipse.persistence.internal.databaseaccess.DatabasePlatform.getMaxFieldNameSize.

Doc from org.eclipse.persistence.internal.databaseaccess.DatabasePlatform.getMaxFieldNameSize.

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

Annotations
@Override
getSelectForUpdateNoWaitStringback to summary
public String getSelectForUpdateNoWaitString()

Overrides org.eclipse.persistence.internal.databaseaccess.DatabasePlatform.getSelectForUpdateNoWaitString.

Doc from org.eclipse.persistence.internal.databaseaccess.DatabasePlatform.getSelectForUpdateNoWaitString.

This syntax does no wait on the lock. (i.e. In Oracle adding FOR UPDATE NOWAIT to the end will accomplish this)

Annotations
@Override
getSelectForUpdateStringback to summary
public String getSelectForUpdateString()

Overrides org.eclipse.persistence.internal.databaseaccess.DatabasePlatform.getSelectForUpdateString.

Doc from org.eclipse.persistence.internal.databaseaccess.DatabasePlatform.getSelectForUpdateString.

Most database support a syntax. although don't actually lock the row. Some require the OF some don't like it.

Annotations
@Override
getTempTableForTableback to summary
public DatabaseTable getTempTableForTable(final DatabaseTable table)

Overrides org.eclipse.persistence.internal.databaseaccess.DatabasePlatform.getTempTableForTable.

Doc from org.eclipse.persistence.internal.databaseaccess.DatabasePlatform.getTempTableForTable.

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

Parameters
table:DatabaseTable

is original table for which temp table is created.

Returns:DatabaseTable

temporary table

Annotations
@Override
initializePlatformOperatorsback to summary
protected void initializePlatformOperators()

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

Doc from org.eclipse.persistence.internal.databaseaccess.DatasourcePlatform.initializePlatformOperators.

Initialize any platform-specific operators

Annotations
@Override
isForUpdateCompatibleWithDistinctback to summary
public boolean isForUpdateCompatibleWithDistinct()

Overrides org.eclipse.persistence.internal.databaseaccess.DatabasePlatform.isForUpdateCompatibleWithDistinct.

Doc from org.eclipse.persistence.internal.databaseaccess.DatabasePlatform.isForUpdateCompatibleWithDistinct.

INTERNAL: Indicates whether SELECT DISTINCT ... FOR UPDATE is allowed by the platform (Oracle doesn't allow this).

Annotations
@Override
isMaxDBback to summary
public boolean isMaxDB()

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

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

Annotations
@Override
printFieldTypeSizeback to summary
protected void printFieldTypeSize(Writer writer, FieldDefinition field, FieldTypeDefinition fieldType) throws IOException

Overrides org.eclipse.persistence.internal.databaseaccess.DatabasePlatform.printFieldTypeSize.

Annotations
@Override
shouldAlwaysUseTempStorageForModifyAllback to summary
public boolean shouldAlwaysUseTempStorageForModifyAll()

Overrides org.eclipse.persistence.internal.databaseaccess.DatabasePlatform.shouldAlwaysUseTempStorageForModifyAll.

Doc from org.eclipse.persistence.internal.databaseaccess.DatabasePlatform.shouldAlwaysUseTempStorageForModifyAll.

INTERNAL: That method affects UpdateAllQuery and DeleteAllQuery execution. In case it returns false modify all queries would attempt to proceed without using temporary storage if it is possible. In case it returns true modify all queries would use temporary storage unless each modify statement doesn't reference any other tables. May need to override this method if the platform can't handle the sql generated for modify all queries without using temporary storage.

Annotations
@Override
shouldBindLiteralsback to summary
public boolean shouldBindLiterals()

Overrides org.eclipse.persistence.internal.databaseaccess.DatabasePlatform.shouldBindLiterals.

Doc from org.eclipse.persistence.internal.databaseaccess.DatabasePlatform.shouldBindLiterals.

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

Annotations
@Override
shouldOptimizeDataConversionback to summary
public boolean shouldOptimizeDataConversion()

Overrides org.eclipse.persistence.internal.databaseaccess.DatabasePlatform.shouldOptimizeDataConversion.

Doc from org.eclipse.persistence.internal.databaseaccess.DatabasePlatform.shouldOptimizeDataConversion.

Return if our driver level data conversion optimization is enabled. This can be disabled as some drivers perform data conversion themselves incorrectly.

Annotations
@Override
shouldPrintOuterJoinInWhereClauseback to summary
public boolean shouldPrintOuterJoinInWhereClause()

Overrides org.eclipse.persistence.internal.databaseaccess.DatabasePlatform.shouldPrintOuterJoinInWhereClause.

Doc from org.eclipse.persistence.internal.databaseaccess.DatabasePlatform.shouldPrintOuterJoinInWhereClause.

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

Annotations
@Override
shouldUseJDBCOuterJoinSyntaxback to summary
public boolean shouldUseJDBCOuterJoinSyntax()

Overrides org.eclipse.persistence.internal.databaseaccess.DatabasePlatform.shouldUseJDBCOuterJoinSyntax.

Doc from org.eclipse.persistence.internal.databaseaccess.DatabasePlatform.shouldUseJDBCOuterJoinSyntax.

JDBC defines and outer join syntax, many drivers do not support this. So we normally avoid it.

Annotations
@Override
supportsIndividualTableLockingback to summary
public boolean supportsIndividualTableLocking()

Overrides org.eclipse.persistence.internal.databaseaccess.DatabasePlatform.supportsIndividualTableLocking.

Doc from org.eclipse.persistence.internal.databaseaccess.DatabasePlatform.supportsIndividualTableLocking.

INTERNAL: Indicates whether locking clause could be selectively applied only to some tables in a ReadQuery. Example: the following locks the rows in SALARY table, doesn't lock the rows in EMPLOYEE table: on Oracle platform (method returns true): SELECT t0.EMP_ID..., t1.SALARY FROM EMPLOYEE t0, SALARY t1 WHERE ... FOR UPDATE t1.SALARY on SQLServer platform (method returns true): SELECT t0.EMP_ID..., t1.SALARY FROM EMPLOYEE t0, SALARY t1 WITH (UPDLOCK) WHERE ...

Annotations
@Override
supportsLocalTempTablesback to summary
public boolean supportsLocalTempTables()

Overrides org.eclipse.persistence.internal.databaseaccess.DatabasePlatform.supportsLocalTempTables.

Doc from org.eclipse.persistence.internal.databaseaccess.DatabasePlatform.supportsLocalTempTables.

INTERNAL: Indicates whether the platform supports local temporary tables. "Local" means that several threads may create temporary tables with the same name. Local temporary table is created in the beginning of UpdateAllQuery execution and dropped in the end of it. Override this method if the platform supports local temporary tables.

Annotations
@Override
supportsNativeSequenceNumbersback to summary
public boolean supportsNativeSequenceNumbers()

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

Annotations
@Override
supportsSequenceObjectsback to summary
public boolean supportsSequenceObjects()

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

Doc from org.eclipse.persistence.internal.databaseaccess.DatasourcePlatform.supportsSequenceObjects.

INTERNAL: Indicates whether the platform supports sequence objects. This method is to be used *ONLY* by sequencing classes

Annotations
@Override
supportsStoredFunctionsback to summary
public boolean supportsStoredFunctions()

Overrides org.eclipse.persistence.internal.databaseaccess.DatabasePlatform.supportsStoredFunctions.

Annotations
@Override