org.eclipse.persistence.platform.database
Class SQLAnywherePlatform

java.lang.Object
  extended by org.eclipse.persistence.internal.databaseaccess.DatasourcePlatform
      extended by org.eclipse.persistence.internal.databaseaccess.DatabasePlatform
          extended by org.eclipse.persistence.platform.database.DatabasePlatform
              extended by org.eclipse.persistence.platform.database.SybasePlatform
                  extended by org.eclipse.persistence.platform.database.SQLAnywherePlatform
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable, org.eclipse.persistence.internal.databaseaccess.Platform

public class SQLAnywherePlatform
extends SybasePlatform

Provides SQL Anywhere specific behaviour.

Author:
Markus KARG (markus-karg@users.sourceforge.net)
See Also:
Serialized Form

Field Summary
 
Fields inherited from class org.eclipse.persistence.internal.databaseaccess.DatabasePlatform
DEFAULT_MAX_BATCH_WRITING_SIZE, DEFAULT_PARAMETERIZED_MAX_BATCH_WRITING_SIZE, Types_NCLOB
 
Constructor Summary
SQLAnywherePlatform()
           
 
Method Summary
 ValueReadQuery buildSelectQueryForIdentity()
          INTERNAL: Build the identity query for native sequencing.
static ExpressionOperator createConcatOperator()
           
static ExpressionOperator createCurrentDateOperator()
           
static ExpressionOperator createCurrentTimeOperator()
           
static ExpressionOperator createLocate2Operator()
           
static ExpressionOperator createLocateOperator()
           
 java.lang.String getBatchBeginString()
          Used for batch writing and sp defs.
 java.lang.String getBatchDelimiterString()
          Used for batch writing and sp defs.
 java.lang.String getBatchEndString()
          Used for batch writing and sp defs.
 java.lang.String getCreationOutputProcedureToken()
          This method is used to print the required output parameter token for the specific platform.
 java.lang.String getInOutputProcedureToken()
          This method is used to print the output parameter token when stored procedures are called
 java.lang.String getInputProcedureToken()
          Used for stored procedure creation: Prefix for INPUT parameters.
 int getJDBCType(java.lang.Class javaType)
          Return the JDBC type for the Java type.
 int getMaxFieldNameSize()
          INTERNAL: returns the maximum number of characters that can be used in a field name on this platform.
 java.lang.String getOutputProcedureToken()
          This method is used to print the output parameter token when stored procedures are called
 java.lang.String getProcedureArgumentString()
          Used for sp defs.
 java.lang.String getProcedureAsString()
          Used for stored procedure defs.
 java.lang.String getProcedureBeginString()
          Used for stored procedure defs.
 java.lang.String getProcedureCallHeader()
          Used for sp calls.
 java.lang.String getProcedureEndString()
          Used for stored procedure defs.
 java.lang.String getStoredProcedureParameterPrefix()
           
 java.lang.String getStoredProcedureTerminationToken()
          INTERNAL: This method returns the delimiter between stored procedures in multiple stored procedure calls.
 org.eclipse.persistence.internal.helper.DatabaseTable getTempTableForTable(org.eclipse.persistence.internal.helper.DatabaseTable table)
          Used for sp calls.
 boolean isSQLAnywhere()
           
 boolean isSybase()
           
 void printFieldIdentityClause(java.io.Writer writer)
          Append the receiver's field 'identity' constraint clause to a writer.
 void printFieldNullClause(java.io.Writer writer)
          Append the receiver's field 'NULL' constraint clause to a writer.
 boolean requiresProcedureBrackets()
          Used for stored procedure creation: Some platforms need brackets around arguments declaration even if no arguments exist.
 boolean requiresProcedureCallBrackets()
          USed for sp calls.
 boolean requiresTypeNameToRegisterOutputParameter()
          INTERNAL: Indicates whether the version of CallableStatement.registerOutputParameter method that takes type name should be used.
 boolean shouldPrintInOutputTokenBeforeType()
          This is required in the construction of the stored procedures with output parameters
 boolean shouldPrintInputTokenAtStart()
          Used for stored procedure creation: Some platforms want to print prefix for INPUT arguments BEFORE NAME.
 boolean shouldPrintOutputTokenAtStart()
          This is required in the construction of the stored procedures with output parameters
 boolean shouldPrintOutputTokenBeforeType()
          This is required in the construction of the stored procedures with output parameters
 boolean shouldPrintStoredProcedureArgumentNameInCall()
          INTERNAL: Should the variable name of a stored procedure call be printed as part of the procedure call e.g.
 boolean shouldPrintStoredProcedureVariablesAfterBeginString()
          Used for stored procedure creation: Some platforms declare variables AFTER the procedure body's BEGIN string.
 boolean supportsIdentity()
          INTERNAL: Indicates whether the platform supports identity.
 boolean supportsLocalTempTables()
          INTERNAL:
 boolean supportsStoredFunctions()
           
 
Methods inherited from class org.eclipse.persistence.platform.database.SybasePlatform
atan2Operator, executeStoredProcedure, getCreationInOutputProcedureToken, getJdbcTypeName, getNativeTableInfo, getSelectForUpdateString, getTimestampQuery, maximumNumericValues, minimumNumericValues, modOperator, registerOutputParameter, requiresProcedureCallOuputToken, shouldPrintLockingClauseAfterWhereClause, shouldUseJDBCOuterJoinSyntax, singleArgumentSubstringOperator, writeUpdateOriginalFromTempTableSql
 
Methods inherited from class org.eclipse.persistence.internal.databaseaccess.DatabasePlatform
addBatch, addStructConverter, allowsSizeInProcedureArguments, appendLiteralToCall, appendParameter, appendParameterInternal, autoCommit, beginTransaction, buildCallWithReturning, buildCreateIndex, buildDropIndex, buildProcedureCallString, buildSelectQueryForIdentity, buildSelectQueryForSequenceObject, buildSelectQueryForSequenceObject, buildSequenceObjectAlterIncrementWriter, buildSequenceObjectCreationWriter, buildSequenceObjectDeletionWriter, canBatchWriteWithOptimisticLocking, canBuildCallWithReturning, commitTransaction, computeMaxRowsForSQL, convertToDatabaseType, copyInto, createArray, createArray, createStruct, createStruct, dontBindUpdateAllQueryUsingTempTables, executeBatch, freeTemporaryObject, getAssignmentString, getCastSizeForVarcharParameter, getClassTypes, getConnection, getConstraintDeletionString, getCreateViewString, getCursorCode, getCustomModifyValueForCall, getFieldTypeDefinition, getFieldTypes, getFunctionCallHeader, getIdentifierQuoteCharacter, getJDBCOuterJoinString, getJDBCType, getMaxBatchWritingSize, getMaxForeignKeyNameSize, getMaxIndexNameSize, getMaxUniqueKeyNameSize, getNoWaitString, getObjectFromResultSet, getPingSQL, getProcedureArgumentSetter, getProcedureCallTail, getQualifiedName, getQualifiedSequenceTableName, getRefValue, getRefValue, getSelectForUpdateNoWaitString, getSelectForUpdateOfString, getSelectForUpdateWaitString, getSequenceCounterFieldName, getSequenceNameFieldName, getSequencePreallocationSize, getSequenceTableName, getStatementCacheSize, getStringBindingSize, getStructConverters, getTransactionIsolation, getTypeConverters, initialize, isAlterSequenceObjectSupported, isCastRequired, isDynamicSQLRequiredForFunctions, isForUpdateCompatibleWithDistinct, isInformixOuterJoin, isLockTimeoutException, isNullAllowedInSelectClause, isXDBDocument, prepareBatchStatement, printFieldNotNullClause, printFieldTypeSize, printFieldUnique, printSQLSelectStatement, printValuelist, printValuelist, requiresNamedPrimaryKeyConstraints, requiresUniqueConstraintCreationOnTableCreate, rollbackTransaction, setCastSizeForVarcharParameter, setCursorCode, setIsCastRequired, setMaxBatchWritingSize, setParameterValueInDatabaseCall, setPingSQL, setPrintOuterJoinInWhereClause, setSequenceCounterFieldName, setSequenceNameFieldName, setSequenceTableName, setShouldBindAllParameters, setShouldBindLiterals, setShouldCacheAllStatements, setShouldForceFieldNamesToUpperCase, setShouldIgnoreCaseOnFieldComparisons, setShouldOptimizeDataConversion, setShouldTrimStrings, setShouldUseRownumFiltering, setStatementCacheSize, setStringBindingSize, setSupportsAutoCommit, setTransactionIsolation, setUsesBatchWriting, setUsesByteArrayBinding, setUsesJDBCBatchWriting, setUsesNativeBatchWriting, setUsesNativeSQL, setUsesStreamsForBinding, setUsesStringBinding, shouldAlwaysUseTempStorageForModifyAll, shouldBindAllParameters, shouldBindLiterals, shouldCacheAllStatements, shouldCreateIndicesForPrimaryKeys, shouldCreateIndicesOnUniqueKeys, shouldForceFieldNamesToUpperCase, shouldIgnoreCaseOnFieldComparisons, shouldIgnoreException, shouldNativeSequenceUseTransaction, shouldOptimizeDataConversion, shouldPrintAliasForUpdate, shouldPrintConstraintNameAfter, shouldPrintFieldIdentityClause, shouldPrintOuterJoinInWhereClause, shouldTrimStrings, shouldUseCustomModifyForCall, shouldUseRownumFiltering, supportsAutoCommit, supportsAutoConversionToNumericForArithmeticOperations, supportsForeignKeyConstraints, supportsGlobalTempTables, supportsIndividualTableLocking, supportsLockingQueriesWithMultipleTables, supportsNativeSequenceNumbers, supportsNestingOuterJoins, supportsOuterJoinsWithBrackets, supportsPrimaryKeyConstraint, supportsSequenceObjects, supportsTempTables, supportsUniqueColumns, supportsUniqueKeyConstraints, usesBatchWriting, usesByteArrayBinding, usesJDBCBatchWriting, usesNativeBatchWriting, usesNativeSQL, usesSequenceTable, usesStreamsForBinding, usesStringBinding, wasFailureCommunicationBased, writeCleanUpTempTableSql, writeCreateTempTableSql, writeDeleteFromTargetTableUsingTempTableSql, writeInsertIntoTableSql, writeLOB, writeParameterMarker
 
Methods inherited from class org.eclipse.persistence.internal.databaseaccess.DatasourcePlatform
addSequence, clone, convertObject, createConnectionCustomizer, getConversionManager, getDataTypesConvertedFrom, getDataTypesConvertedTo, getDefaultSequence, getDefaultSequenceToWrite, getEndDelimiter, getOperator, getPlatformOperators, getSelectSequenceQuery, getSequence, getSequences, getSequencesToWrite, getStartDelimiter, getTableQualifier, getTimestampFromServer, getUpdateSequenceQuery, hasDefaultSequence, isAccess, isAttunity, isCloudscape, isDB2, isDBase, isDerby, isFirebird, isH2, isHSQL, isInformix, isMySQL, isODBC, isOracle, isOracle9, isPointBase, isPostgreSQL, isSQLServer, isTimesTen, isTimesTen7, removeAllSequences, removeSequence, setConversionManager, setDefaultSequence, setEndDelimiter, setSelectSequenceNumberQuery, setSequencePreallocationSize, setSequences, setStartDelimiter, setTableQualifier, setTimestampQuery, setUpdateSequenceQuery, toString, usesPlatformDefaultSequence
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SQLAnywherePlatform

public SQLAnywherePlatform()
Method Detail

buildSelectQueryForIdentity

public ValueReadQuery buildSelectQueryForIdentity()
INTERNAL: Build the identity query for native sequencing.

Overrides:
buildSelectQueryForIdentity in class SybasePlatform

createCurrentDateOperator

public static ExpressionOperator createCurrentDateOperator()

createCurrentTimeOperator

public static ExpressionOperator createCurrentTimeOperator()

createLocate2Operator

public static ExpressionOperator createLocate2Operator()

createConcatOperator

public static ExpressionOperator createConcatOperator()

createLocateOperator

public static ExpressionOperator createLocateOperator()

getInputProcedureToken

public java.lang.String getInputProcedureToken()
Used for stored procedure creation: Prefix for INPUT parameters. Not required on most platforms.

Overrides:
getInputProcedureToken in class org.eclipse.persistence.internal.databaseaccess.DatabasePlatform

getInOutputProcedureToken

public java.lang.String getInOutputProcedureToken()
Description copied from class: org.eclipse.persistence.internal.databaseaccess.DatabasePlatform
This method is used to print the output parameter token when stored procedures are called

Overrides:
getInOutputProcedureToken in class SybasePlatform

getCreationOutputProcedureToken

public java.lang.String getCreationOutputProcedureToken()
Description copied from class: org.eclipse.persistence.internal.databaseaccess.DatabasePlatform
This method is used to print the required output parameter token for the specific platform. Used when stored procedures are created.

Overrides:
getCreationOutputProcedureToken in class SybasePlatform

getOutputProcedureToken

public java.lang.String getOutputProcedureToken()
Description copied from class: org.eclipse.persistence.internal.databaseaccess.DatabasePlatform
This method is used to print the output parameter token when stored procedures are called

Overrides:
getOutputProcedureToken in class SybasePlatform

getJDBCType

public int getJDBCType(java.lang.Class javaType)
Description copied from class: org.eclipse.persistence.internal.databaseaccess.DatabasePlatform
Return the JDBC type for the Java type.

Overrides:
getJDBCType in class org.eclipse.persistence.internal.databaseaccess.DatabasePlatform

getMaxFieldNameSize

public int getMaxFieldNameSize()
Description copied from class: SybasePlatform
INTERNAL: returns the maximum number of characters that can be used in a field name on this platform.

Overrides:
getMaxFieldNameSize in class SybasePlatform

getProcedureArgumentString

public java.lang.String getProcedureArgumentString()
Used for sp defs.

Overrides:
getProcedureArgumentString in class SybasePlatform

getStoredProcedureParameterPrefix

public java.lang.String getStoredProcedureParameterPrefix()
Overrides:
getStoredProcedureParameterPrefix in class SybasePlatform

getStoredProcedureTerminationToken

public java.lang.String getStoredProcedureTerminationToken()
Description copied from class: SybasePlatform
INTERNAL: This method returns the delimiter between stored procedures in multiple stored procedure calls.

Overrides:
getStoredProcedureTerminationToken in class SybasePlatform

getProcedureAsString

public java.lang.String getProcedureAsString()
Description copied from class: org.eclipse.persistence.internal.databaseaccess.DatabasePlatform
Used for stored procedure defs.

Overrides:
getProcedureAsString in class org.eclipse.persistence.internal.databaseaccess.DatabasePlatform

getProcedureBeginString

public java.lang.String getProcedureBeginString()
Description copied from class: org.eclipse.persistence.internal.databaseaccess.DatabasePlatform
Used for stored procedure defs.

Overrides:
getProcedureBeginString in class org.eclipse.persistence.internal.databaseaccess.DatabasePlatform

getProcedureEndString

public java.lang.String getProcedureEndString()
Description copied from class: org.eclipse.persistence.internal.databaseaccess.DatabasePlatform
Used for stored procedure defs.

Overrides:
getProcedureEndString in class org.eclipse.persistence.internal.databaseaccess.DatabasePlatform

getBatchBeginString

public java.lang.String getBatchBeginString()
Used for batch writing and sp defs.

Overrides:
getBatchBeginString in class org.eclipse.persistence.internal.databaseaccess.DatabasePlatform

getBatchEndString

public java.lang.String getBatchEndString()
Used for batch writing and sp defs.

Overrides:
getBatchEndString in class org.eclipse.persistence.internal.databaseaccess.DatabasePlatform

getBatchDelimiterString

public java.lang.String getBatchDelimiterString()
Used for batch writing and sp defs.

Overrides:
getBatchDelimiterString in class SybasePlatform

getProcedureCallHeader

public java.lang.String getProcedureCallHeader()
Used for sp calls.

Overrides:
getProcedureCallHeader in class SybasePlatform

getTempTableForTable

public org.eclipse.persistence.internal.helper.DatabaseTable getTempTableForTable(org.eclipse.persistence.internal.helper.DatabaseTable table)
Used for sp calls.

Overrides:
getTempTableForTable in class SybasePlatform
Returns:
DatabaseTable temorary table

isSQLAnywhere

public boolean isSQLAnywhere()
Specified by:
isSQLAnywhere in interface org.eclipse.persistence.internal.databaseaccess.Platform
Overrides:
isSQLAnywhere in class org.eclipse.persistence.internal.databaseaccess.DatasourcePlatform

isSybase

public boolean isSybase()
Specified by:
isSybase in interface org.eclipse.persistence.internal.databaseaccess.Platform
Overrides:
isSybase in class SybasePlatform

requiresProcedureBrackets

public boolean requiresProcedureBrackets()
Description copied from class: org.eclipse.persistence.internal.databaseaccess.DatabasePlatform
Used for stored procedure creation: Some platforms need brackets around arguments declaration even if no arguments exist. Those platform will override this and return true. All other platforms will omit the brackets in this case.

Overrides:
requiresProcedureBrackets in class org.eclipse.persistence.internal.databaseaccess.DatabasePlatform

requiresProcedureCallBrackets

public boolean requiresProcedureCallBrackets()
Description copied from class: SybasePlatform
USed for sp calls.

Overrides:
requiresProcedureCallBrackets in class SybasePlatform

requiresTypeNameToRegisterOutputParameter

public boolean requiresTypeNameToRegisterOutputParameter()
INTERNAL: Indicates whether the version of CallableStatement.registerOutputParameter method that takes type name should be used.

Overrides:
requiresTypeNameToRegisterOutputParameter in class SybasePlatform

printFieldIdentityClause

public void printFieldIdentityClause(java.io.Writer writer)
                              throws ValidationException
Description copied from class: SybasePlatform
Append the receiver's field 'identity' constraint clause to a writer.

Overrides:
printFieldIdentityClause in class SybasePlatform
Throws:
ValidationException

printFieldNullClause

public void printFieldNullClause(java.io.Writer writer)
                          throws ValidationException
Description copied from class: SybasePlatform
Append the receiver's field 'NULL' constraint clause to a writer.

Overrides:
printFieldNullClause in class SybasePlatform
Throws:
ValidationException

shouldPrintInputTokenAtStart

public boolean shouldPrintInputTokenAtStart()
Description copied from class: org.eclipse.persistence.internal.databaseaccess.DatabasePlatform
Used for stored procedure creation: Some platforms want to print prefix for INPUT arguments BEFORE NAME. If wanted, override and return true.

Overrides:
shouldPrintInputTokenAtStart in class org.eclipse.persistence.internal.databaseaccess.DatabasePlatform

shouldPrintInOutputTokenBeforeType

public boolean shouldPrintInOutputTokenBeforeType()
Description copied from class: org.eclipse.persistence.internal.databaseaccess.DatabasePlatform
This is required in the construction of the stored procedures with output parameters

Overrides:
shouldPrintInOutputTokenBeforeType in class SybasePlatform

shouldPrintOutputTokenAtStart

public boolean shouldPrintOutputTokenAtStart()
Description copied from class: org.eclipse.persistence.internal.databaseaccess.DatabasePlatform
This is required in the construction of the stored procedures with output parameters

Overrides:
shouldPrintOutputTokenAtStart in class org.eclipse.persistence.internal.databaseaccess.DatabasePlatform

shouldPrintOutputTokenBeforeType

public boolean shouldPrintOutputTokenBeforeType()
Description copied from class: org.eclipse.persistence.internal.databaseaccess.DatabasePlatform
This is required in the construction of the stored procedures with output parameters

Overrides:
shouldPrintOutputTokenBeforeType in class SybasePlatform

shouldPrintStoredProcedureArgumentNameInCall

public boolean shouldPrintStoredProcedureArgumentNameInCall()
Description copied from class: org.eclipse.persistence.internal.databaseaccess.DatabasePlatform
INTERNAL: Should the variable name of a stored procedure call be printed as part of the procedure call e.g. EXECUTE PROCEDURE MyStoredProc(myvariable = ?)

Overrides:
shouldPrintStoredProcedureArgumentNameInCall in class org.eclipse.persistence.internal.databaseaccess.DatabasePlatform

shouldPrintStoredProcedureVariablesAfterBeginString

public boolean shouldPrintStoredProcedureVariablesAfterBeginString()
Description copied from class: org.eclipse.persistence.internal.databaseaccess.DatabasePlatform
Used for stored procedure creation: Some platforms declare variables AFTER the procedure body's BEGIN string. These need to override and return true. All others will print the variable declaration BEFORE the body's BEGIN string.

Overrides:
shouldPrintStoredProcedureVariablesAfterBeginString in class org.eclipse.persistence.internal.databaseaccess.DatabasePlatform

supportsIdentity

public boolean supportsIdentity()
Description copied from class: SybasePlatform
INTERNAL: Indicates whether the platform supports identity. Sybase does through IDENTITY field types. This method is to be used *ONLY* by sequencing classes

Overrides:
supportsIdentity in class SybasePlatform

supportsLocalTempTables

public boolean supportsLocalTempTables()
Description copied from class: SybasePlatform
INTERNAL:

Overrides:
supportsLocalTempTables in class SybasePlatform

supportsStoredFunctions

public boolean supportsStoredFunctions()
Overrides:
supportsStoredFunctions in class org.eclipse.persistence.internal.databaseaccess.DatabasePlatform