public class SQLServerPlatform extends DatabasePlatform
Purpose: Provides SQL Server specific behaviour.
Responsibilities:
classTypes, cursorCode, fieldTypes, shouldBindAllParameters, shouldCacheAllStatements, shouldForceFieldNamesToUpperCase, shouldIgnoreCaseOnFieldComparisons, shouldOptimizeDataConversion, shouldTrimStrings, statementCacheSize, stringBindingSize, supportsAutoCommit, transactionIsolation, usesByteArrayBinding, usesNativeSQL, usesStreamsForBinding, usesStringBinding
conversionManager, dataTypesConvertedFromAClass, dataTypesConvertedToAClass, defaultSequence, platformOperators, sequences, tableQualifier, timestampQuery
Constructor and Description |
---|
SQLServerPlatform() |
Modifier and Type | Method and Description |
---|---|
protected void |
appendByteArray(byte[] bytes,
Writer writer)
INTERNAL:
If using native SQL then print a byte[] as '0xFF...'
|
protected void |
appendCalendar(Calendar calendar,
Writer writer)
INTERNAL:
Answer a platform correct string representation of a Calendar, suitable for SQL generation.
|
protected void |
appendDate(Date date,
Writer writer)
INTERNAL:
Answer a platform correct string representation of a Date, suitable for SQL generation.
|
protected void |
appendSybaseCalendar(Calendar calendar,
Writer writer)
INTERNAL:
Write a timestamp in Sybase specific format ( yyyy-mm-dd-hh.mm.ss.fff)
|
protected void |
appendSybaseTimestamp(Timestamp timestamp,
Writer writer)
INTERNAL:
Write a timestamp in Sybase specific format ( yyyy-mm-dd-hh.mm.ss.fff)
|
protected void |
appendTime(Time time,
Writer writer)
INTERNAL:
Answer a platform correct string representation of a Time, suitable for SQL generation.
|
protected void |
appendTimestamp(Timestamp timestamp,
Writer writer)
INTERNAL:
Answer a platform correct string representation of a Timestamp, suitable for SQL generation.
|
protected Hashtable |
buildFieldTypes()
Return the mapping of class types to database types for the schema framework.
|
ValueReadQuery |
buildSelectQueryForNativeSequence()
INTERNAL:
Build the identity query for native sequencing.
|
String |
getBatchDelimiterString()
INTERNAL:
Used for batch writing and sp defs.
|
protected String |
getCreateTempTableSqlPrefix()
INTERNAL:
|
String |
getCreationInOutputProcedureToken()
INTERNAL:
This method is used to print the required output parameter token for the
specific platform.
|
String |
getCreationOutputProcedureToken()
INTERNAL:
This method is used to print the required output parameter token for the
specific platform.
|
String |
getInOutputProcedureToken()
INTERNAL:
This method is used to print the output parameter token when stored
procedures are called
|
int |
getMaxFieldNameSize()
INTERNAL:
returns the maximum number of characters that can be used in a field
name on this platform.
|
Vector |
getNativeTableInfo(String table,
String creator,
AbstractSession session)
INTERNAL:
Return the catalog information through using the native SQL catalog selects.
|
String |
getOutputProcedureToken()
INTERNAL:
This method is used to print the output parameter token when stored
procedures are called
|
String |
getProcedureArgumentString()
INTERNAL:
Used for sp defs.
|
String |
getProcedureCallHeader()
INTERNAL:
Used for sp calls.
|
String |
getSelectForUpdateString()
INTERNAL:
|
String |
getStoredProcedureParameterPrefix()
INTERNAL:
|
String |
getStoredProcedureTerminationToken()
INTERNAL:
This method returns the delimiter between stored procedures in multiple stored procedure calls.
|
DatabaseTable |
getTempTableForTable(DatabaseTable table)
INTERNAL:
|
ValueReadQuery |
getTimestampQuery()
INTERNAL:
This method returns the query to select the timestamp
from the server for SQLServer.
|
protected void |
initializePlatformOperators()
INTERNAL:
Initialize any platform-specific operators
|
boolean |
isSQLServer() |
static ExpressionOperator |
locate2Operator()
INTERNAL:
create the Locate2 Operator for this platform
|
Hashtable |
maximumNumericValues()
INTERNAL:
Builds a table of maximum numeric values keyed on java class.
|
Hashtable |
minimumNumericValues()
INTERNAL:
Builds a table of minimum numeric values keyed on java class.
|
ExpressionOperator |
modOperator()
INTERNAL:
Override the default MOD operator.
|
protected ExpressionOperator |
operatorOuterJoin()
INTERNAL:
Create the outer join operator for this platform.
|
void |
printFieldIdentityClause(Writer writer)
INTERNAL:
Append the receiver's field 'identity' constraint clause to a writer.
|
void |
printFieldNullClause(Writer writer)
INTERNAL:
Append the receiver's field 'NULL' constraint clause to a writer.
|
boolean |
requiresProcedureCallBrackets()
INTERNAL:
Used for sp calls.
|
boolean |
requiresProcedureCallOuputToken()
INTERNAL:
Used for sp calls.
|
boolean |
shouldNativeSequenceAcquireValueAfterInsert()
INTERNAL:
If native sequencing is being used on Sybase then the values must be
retrieved after the insert.
|
boolean |
shouldPrintInOutputTokenBeforeType()
INTERNAL:
This is required in the construction of the stored procedures with
output parameters
|
boolean |
shouldPrintOuterJoinInWhereClause()
INTERNAL:
Some database require outer joins to be given in the where clause, others require it in the from clause.
|
boolean |
shouldPrintOutputTokenBeforeType()
INTERNAL:
This is required in the construction of the stored procedures with
output parameters
|
boolean |
shouldUseJDBCOuterJoinSyntax()
INTERNAL:
JDBC defines and outer join syntax, many drivers do not support this.
|
boolean |
supportsLocalTempTables()
INTERNAL:
|
boolean |
supportsNativeSequenceNumbers()
INTERNAL:
Return true if the receiver uses host sequence numbers, generated on the database.
|
void |
writeUpdateOriginalFromTempTableSql(Writer writer,
DatabaseTable table,
Collection pkFields,
Collection assignedFields)
INTERNAL:
|
allowsSizeInProcedureArguments, appendBoolean, appendLiteralToCall, appendLiteralToCallWithBinding, appendNumber, appendParameter, appendParameterInternal, appendString, autoCommit, beginTransaction, buildCallWithReturning, buildClassTypes, buildSelectQueryForNativeSequence, canBuildCallWithReturning, commitTransaction, convertToDatabaseType, copyInto, createPlatformDefaultSequence, dontBindUpdateAllQueryUsingTempTables, executeStoredProcedure, getAssignmentString, getBatchBeginString, getBatchEndString, getClassTypes, getConstraintDeletionString, getCreateTempTableSqlBodyForTable, getCreateTempTableSqlSuffix, getCreateViewString, getCursorCode, getFieldTypeDefinition, getFieldTypes, getFunctionCallHeader, getJDBCOuterJoinString, getJDBCType, getJDBCType, getJdbcTypeName, getMaxForeignKeyNameSize, getMaxUniqueKeyNameSize, getObjectFromResultSet, getProcedureArgumentSetter, getProcedureAsString, getProcedureBeginString, getProcedureCallTail, getProcedureEndString, getQualifiedSequenceTableName, getSelectForUpdateNoWaitString, getSelectForUpdateOfString, getSequenceCounterFieldName, getSequenceNameFieldName, getSequencePreallocationSize, getSequenceTableName, getStatementCacheSize, getStringBindingSize, getTransactionIsolation, isInformixOuterJoin, isNullAllowedInSelectClause, printFieldIdentityClause, printFieldNotNullClause, printFieldTypeSize, printFieldUnique, printValuelist, printValuelist, processResultSet, registerOutputParameter, requiresNamedPrimaryKeyConstraints, requiresTypeNameToRegisterOutputParameter, rollbackTransaction, setClassTypes, setCursorCode, setFieldTypes, setParameterValueInDatabaseCall, setParameterValueInDatabaseCall, setParameterValueInDatabaseCall, setPrimitiveParameterValue, setSequenceCounterFieldName, setSequenceNameFieldName, setSequenceTableName, setShouldBindAllParameters, setShouldCacheAllStatements, setShouldForceFieldNamesToUpperCase, setShouldIgnoreCaseOnFieldComparisons, setShouldOptimizeDataConversion, setShouldTrimStrings, setStatementCacheSize, setStringBindingSize, setSupportsAutoCommit, setTransactionIsolation, setUsesByteArrayBinding, setUsesNativeSQL, setUsesStreamsForBinding, setUsesStringBinding, shouldAcquireSequenceValueAfterInsert, shouldAlwaysUseTempStorageForModifyAll, shouldBindAllParameters, shouldBindLiterals, shouldCacheAllStatements, shouldForceFieldNamesToUpperCase, shouldIgnoreCaseOnFieldComparisons, shouldIgnoreException, shouldNativeSequenceUseTransaction, shouldOptimizeDataConversion, shouldPrintConstraintNameAfter, shouldPrintOutputTokenAtStart, shouldTempTableSpecifyPrimaryKeys, shouldTrimStrings, supportsAutoCommit, supportsForeignKeyConstraints, supportsGlobalTempTables, supportsPrimaryKeyConstraint, supportsStoredFunctions, supportsTempTables, supportsUniqueKeyConstraints, usesByteArrayBinding, usesNativeSQL, usesSequenceTable, usesStreamsForBinding, usesStringBinding, writeAutoAssignmentSetClause, writeAutoJoinWhereClause, writeCleanUpTempTableSql, writeCreateTempTableSql, writeDeleteFromTargetTableUsingTempTableSql, writeFields, writeFieldsAutoClause, writeFieldsList, writeInsertIntoTableSql, writeJoinWhereClause, writeLOB, writeParameterMarker
addOperator, addSequence, clone, convertObject, createSequences, getConversionManager, getCustomModifyValueForCall, getDataTypesConvertedFrom, getDataTypesConvertedTo, getDefaultSequence, getDefaultSequenceToWrite, getOperator, getPlatformOperators, getSequence, getSequences, getSequencesToWrite, getTableQualifier, getTimestampFromServer, hasDefaultSequence, isAccess, isAttunity, isCloudscape, isDB2, isDBase, isDerby, isHSQL, isInformix, isMySQL, isODBC, isOracle, isPointBase, isPostgreSQL, isSQLAnywhere, isSybase, isTimesTen, platformSpecificSequencingInitialization, removeAllSequences, removeSequence, sequencesAfterCloneCleanup, setConversionManager, setDefaultSequence, setSequences, setTableQualifier, setTimestampQuery, shouldUseCustomModifyForCall, toString, usesPlatformDefaultSequence
protected void appendByteArray(byte[] bytes, Writer writer) throws IOException
appendByteArray
in class DatabasePlatform
IOException
protected void appendDate(Date date, Writer writer) throws IOException
appendDate
in class DatabasePlatform
IOException
protected void appendSybaseTimestamp(Timestamp timestamp, Writer writer) throws IOException
IOException
protected void appendSybaseCalendar(Calendar calendar, Writer writer) throws IOException
IOException
protected void appendTime(Time time, Writer writer) throws IOException
appendTime
in class DatabasePlatform
IOException
protected void appendTimestamp(Timestamp timestamp, Writer writer) throws IOException
appendTimestamp
in class DatabasePlatform
IOException
protected void appendCalendar(Calendar calendar, Writer writer) throws IOException
appendCalendar
in class DatabasePlatform
IOException
protected Hashtable buildFieldTypes()
DatabasePlatform
buildFieldTypes
in class DatabasePlatform
public ValueReadQuery buildSelectQueryForNativeSequence()
buildSelectQueryForNativeSequence
in class DatabasePlatform
public String getBatchDelimiterString()
getBatchDelimiterString
in class DatabasePlatform
public String getCreationInOutputProcedureToken()
getCreationInOutputProcedureToken
in class DatabasePlatform
public String getCreationOutputProcedureToken()
getCreationOutputProcedureToken
in class DatabasePlatform
public String getInOutputProcedureToken()
getInOutputProcedureToken
in class DatabasePlatform
public int getMaxFieldNameSize()
getMaxFieldNameSize
in class DatabasePlatform
public Vector getNativeTableInfo(String table, String creator, AbstractSession session)
public String getOutputProcedureToken()
getOutputProcedureToken
in class DatabasePlatform
public String getProcedureArgumentString()
getProcedureArgumentString
in class DatabasePlatform
public String getSelectForUpdateString()
getSelectForUpdateString
in class DatabasePlatform
public String getProcedureCallHeader()
getProcedureCallHeader
in class DatabasePlatform
public String getStoredProcedureParameterPrefix()
getStoredProcedureParameterPrefix
in class DatabasePlatform
public String getStoredProcedureTerminationToken()
getStoredProcedureTerminationToken
in class DatabasePlatform
public ValueReadQuery getTimestampQuery()
getTimestampQuery
in interface Platform
getTimestampQuery
in class DatasourcePlatform
protected void initializePlatformOperators()
initializePlatformOperators
in class DatasourcePlatform
public boolean isSQLServer()
isSQLServer
in interface Platform
isSQLServer
in class DatasourcePlatform
public Hashtable maximumNumericValues()
NOTE: BigInteger & BigDecimal maximums are dependent upon their precision & Scale
maximumNumericValues
in class DatabasePlatform
public Hashtable minimumNumericValues()
NOTE: BigInteger & BigDecimal minimums are dependent upon their precision & Scale
minimumNumericValues
in class DatabasePlatform
public ExpressionOperator modOperator()
protected ExpressionOperator operatorOuterJoin()
public static ExpressionOperator locate2Operator()
public void printFieldIdentityClause(Writer writer) throws ValidationException
printFieldIdentityClause
in class DatabasePlatform
ValidationException
public void printFieldNullClause(Writer writer) throws ValidationException
printFieldNullClause
in class DatabasePlatform
ValidationException
public boolean requiresProcedureCallBrackets()
requiresProcedureCallBrackets
in class DatabasePlatform
public boolean requiresProcedureCallOuputToken()
requiresProcedureCallOuputToken
in class DatabasePlatform
public boolean shouldPrintInOutputTokenBeforeType()
shouldPrintInOutputTokenBeforeType
in class DatabasePlatform
public boolean shouldPrintOuterJoinInWhereClause()
shouldPrintOuterJoinInWhereClause
in class DatabasePlatform
public boolean shouldPrintOutputTokenBeforeType()
shouldPrintOutputTokenBeforeType
in class DatabasePlatform
public boolean shouldNativeSequenceAcquireValueAfterInsert()
shouldNativeSequenceAcquireValueAfterInsert
in class DatabasePlatform
public boolean shouldUseJDBCOuterJoinSyntax()
shouldUseJDBCOuterJoinSyntax
in class DatabasePlatform
public boolean supportsNativeSequenceNumbers()
supportsNativeSequenceNumbers
in class DatabasePlatform
public boolean supportsLocalTempTables()
supportsLocalTempTables
in class DatabasePlatform
protected String getCreateTempTableSqlPrefix()
getCreateTempTableSqlPrefix
in class DatabasePlatform
public DatabaseTable getTempTableForTable(DatabaseTable table)
getTempTableForTable
in class DatabasePlatform
public void writeUpdateOriginalFromTempTableSql(Writer writer, DatabaseTable table, Collection pkFields, Collection assignedFields) throws IOException
writeUpdateOriginalFromTempTableSql
in class DatabasePlatform
IOException
Copyright © 2023. All rights reserved.