org.jumpmind.symmetric.db.mssql
Class MsSqlDbDialect

java.lang.Object
  extended by org.jumpmind.symmetric.db.AbstractDbDialect
      extended by org.jumpmind.symmetric.db.mssql.MsSqlDbDialect
All Implemented Interfaces:
IDbDialect

public class MsSqlDbDialect
extends AbstractDbDialect
implements IDbDialect

This dialect was tested with the jTDS JDBC driver on SQL Server 2005. TODO support text and image fields, they cannot be referenced from the inserted or deleted tables in the triggers. Here is one idea we could implement: http://www.devx.com/getHelpOn/10MinuteSolution/16544


Field Summary
 
Fields inherited from class org.jumpmind.symmetric.db.AbstractDbDialect
cachedModel, jdbcTemplate, MAX_SYMMETRIC_SUPPORTED_TRIGGER_SIZE, platform, sqlErrorTranslator, sqlTemplate, tablePrefix, transactionTemplate
 
Constructor Summary
MsSqlDbDialect()
           
 
Method Summary
protected  boolean allowsNullForIdentityColumn()
           
 void cleanupAfterDataLoad(org.apache.ddlutils.model.Table table)
          This is called by the data loader each time the table context changes away from a table or when the the data loader is closed, giving the dialect an opportunity to do any post loading work for the given table.
 void disableSyncTriggers(java.lang.String nodeId)
           
protected  boolean doesTriggerExistOnPlatform(java.lang.String catalogName, java.lang.String schema, java.lang.String tableName, java.lang.String triggerName)
           
 void enableSyncTriggers()
           
 BinaryEncoding getBinaryEncoding()
           
 IColumnFilter getDatabaseColumnFilter()
           
 java.lang.String getDefaultCatalog()
           
 java.lang.String getDefaultSchema()
           
 java.lang.String getSyncTriggersExpression()
           
 java.lang.String getTransactionTriggerExpression(Trigger trigger)
           
protected  void initForSpecificDialect()
           
 boolean isCharSpacePadded()
          SQL Server always pads character fields out to the right to fill out field with space characters.
 boolean isCharSpaceTrimmed()
           
 boolean isDateOverrideToTimestamp()
           
 boolean isEmptyStringNulled()
          SQL Server pads an empty string with spaces.
 boolean isTransactionIdOverrideSupported()
          An indicator as to whether the ability to override the default transaction id provided by the dialect can be overridden in the trigger configuration.
 void prepareTableForDataLoad(org.apache.ddlutils.model.Table table)
          This is called by the data loader each time the table context changes, giving the dialect an opportunity to do any pre loading work.
 void purge()
          Nothing to do for SQL Server
 void removeTrigger(java.lang.String catalogName, java.lang.String schemaName, java.lang.String triggerName, java.lang.String tableName, TriggerHistory oldHistory)
           
 boolean storesUpperCaseNamesInCatalog()
           
 boolean supportsTransactionId()
           
 
Methods inherited from class org.jumpmind.symmetric.db.AbstractDbDialect
addPrefixAndCreateTablesIfNecessary, createCsvDataSql, createCsvPrimaryKeySql, createInitalLoadSqlFor, createPostTriggerDDL, createPurgeSqlFor, createRequiredFunctions, createSavepoint, createSavepointForFallback, createTables, determineAutoIncrementFromResultSetMetaData, disableSyncTriggers, doesDatabaseNeedConfigured, doesTriggerExist, findTable, fixForeignKeys, getConfigDdlDatabase, getConfigDdlXml, getCreateSymmetricDDL, getCreateTableSQL, getCreateTableXML, getEngineName, getIdentifierQuoteString, getJdbcTemplate, getMajorVersion, getMaxTriggerNameLength, getMetaDataFor, getMetaDataFor, getMinorVersion, getName, getPlatform, getProductVersion, getSelectLastInsertIdSql, getSequenceName, getSqlErrorTranslator, getStreamingResultsFetchSize, getTablePrefix, getTriggerName, getVersion, init, initColumnsForColumn, initColumnsForIndex, initColumnsForPK, initColumnsForTable, initConfigDb, initTrigger, insertWithGeneratedKey, insertWithGeneratedKey, isBlobOverrideToBinary, isBlobSyncSupported, isClobSyncSupported, makeAllColumnsPrimaryKeysIfNoPrimaryKeysFound, prefixConfigDatabase, readColumn, readColumns, readColumns, readIndex, readIndices, readPrimaryKeyName, readPrimaryKeyNames, readTable, releaseSavepoint, replaceTemplateVariables, requiresSavepointForFallback, rollbackToSavepoint, setParameterService, setSqlTemplate, setStreamingResultsFetchSize, setTablePrefix, setTransactionTemplate, storesLowerCaseNamesInCatalog, supportsGetGeneratedKeys, switchCatalogForTriggerInstall
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.jumpmind.symmetric.db.IDbDialect
createCsvDataSql, createCsvPrimaryKeySql, createInitalLoadSqlFor, createPurgeSqlFor, createSavepoint, createSavepointForFallback, createTables, disableSyncTriggers, doesDatabaseNeedConfigured, doesTriggerExist, getCreateSymmetricDDL, getCreateTableSQL, getCreateTableXML, getEngineName, getIdentifierQuoteString, getJdbcTemplate, getMajorVersion, getMaxTriggerNameLength, getMetaDataFor, getMetaDataFor, getMinorVersion, getName, getPlatform, getProductVersion, getSelectLastInsertIdSql, getSqlErrorTranslator, getStreamingResultsFetchSize, getTablePrefix, getTriggerName, getVersion, initConfigDb, initTrigger, insertWithGeneratedKey, insertWithGeneratedKey, isBlobOverrideToBinary, isBlobSyncSupported, isClobSyncSupported, releaseSavepoint, replaceTemplateVariables, requiresSavepointForFallback, rollbackToSavepoint, storesLowerCaseNamesInCatalog
 

Constructor Detail

MsSqlDbDialect

public MsSqlDbDialect()
Method Detail

initForSpecificDialect

protected void initForSpecificDialect()
Specified by:
initForSpecificDialect in class AbstractDbDialect

allowsNullForIdentityColumn

protected boolean allowsNullForIdentityColumn()
Overrides:
allowsNullForIdentityColumn in class AbstractDbDialect

getDatabaseColumnFilter

public IColumnFilter getDatabaseColumnFilter()
Specified by:
getDatabaseColumnFilter in interface IDbDialect
Overrides:
getDatabaseColumnFilter in class AbstractDbDialect

prepareTableForDataLoad

public void prepareTableForDataLoad(org.apache.ddlutils.model.Table table)
Description copied from interface: IDbDialect
This is called by the data loader each time the table context changes, giving the dialect an opportunity to do any pre loading work. Only one table is active at any one point.

Specified by:
prepareTableForDataLoad in interface IDbDialect
Overrides:
prepareTableForDataLoad in class AbstractDbDialect

cleanupAfterDataLoad

public void cleanupAfterDataLoad(org.apache.ddlutils.model.Table table)
Description copied from interface: IDbDialect
This is called by the data loader each time the table context changes away from a table or when the the data loader is closed, giving the dialect an opportunity to do any post loading work for the given table.

Specified by:
cleanupAfterDataLoad in interface IDbDialect
Overrides:
cleanupAfterDataLoad in class AbstractDbDialect

getBinaryEncoding

public BinaryEncoding getBinaryEncoding()
Specified by:
getBinaryEncoding in interface IDbDialect
Overrides:
getBinaryEncoding in class AbstractDbDialect

doesTriggerExistOnPlatform

protected boolean doesTriggerExistOnPlatform(java.lang.String catalogName,
                                             java.lang.String schema,
                                             java.lang.String tableName,
                                             java.lang.String triggerName)
Specified by:
doesTriggerExistOnPlatform in class AbstractDbDialect

disableSyncTriggers

public void disableSyncTriggers(java.lang.String nodeId)
Specified by:
disableSyncTriggers in interface IDbDialect

enableSyncTriggers

public void enableSyncTriggers()
Specified by:
enableSyncTriggers in interface IDbDialect

getSyncTriggersExpression

public java.lang.String getSyncTriggersExpression()
Specified by:
getSyncTriggersExpression in interface IDbDialect

getTransactionTriggerExpression

public java.lang.String getTransactionTriggerExpression(Trigger trigger)
Specified by:
getTransactionTriggerExpression in interface IDbDialect
Overrides:
getTransactionTriggerExpression in class AbstractDbDialect

supportsTransactionId

public boolean supportsTransactionId()
Specified by:
supportsTransactionId in interface IDbDialect
Overrides:
supportsTransactionId in class AbstractDbDialect

isCharSpacePadded

public boolean isCharSpacePadded()
SQL Server always pads character fields out to the right to fill out field with space characters.

Specified by:
isCharSpacePadded in interface IDbDialect
Returns:
true always

isCharSpaceTrimmed

public boolean isCharSpaceTrimmed()
Specified by:
isCharSpaceTrimmed in interface IDbDialect
Returns:
false always

isTransactionIdOverrideSupported

public boolean isTransactionIdOverrideSupported()
Description copied from interface: IDbDialect
An indicator as to whether the ability to override the default transaction id provided by the dialect can be overridden in the trigger configuration.

Specified by:
isTransactionIdOverrideSupported in interface IDbDialect
Overrides:
isTransactionIdOverrideSupported in class AbstractDbDialect

isDateOverrideToTimestamp

public boolean isDateOverrideToTimestamp()
Specified by:
isDateOverrideToTimestamp in interface IDbDialect
Overrides:
isDateOverrideToTimestamp in class AbstractDbDialect

isEmptyStringNulled

public boolean isEmptyStringNulled()
SQL Server pads an empty string with spaces.

Specified by:
isEmptyStringNulled in interface IDbDialect
Returns:
false always

purge

public void purge()
Nothing to do for SQL Server

Specified by:
purge in interface IDbDialect

getDefaultCatalog

public java.lang.String getDefaultCatalog()
Specified by:
getDefaultCatalog in interface IDbDialect

getDefaultSchema

public java.lang.String getDefaultSchema()
Specified by:
getDefaultSchema in interface IDbDialect

removeTrigger

public void removeTrigger(java.lang.String catalogName,
                          java.lang.String schemaName,
                          java.lang.String triggerName,
                          java.lang.String tableName,
                          TriggerHistory oldHistory)
Specified by:
removeTrigger in interface IDbDialect

storesUpperCaseNamesInCatalog

public boolean storesUpperCaseNamesInCatalog()
Specified by:
storesUpperCaseNamesInCatalog in interface IDbDialect
Overrides:
storesUpperCaseNamesInCatalog in class AbstractDbDialect


Copyright © 2007-2008. All Rights Reserved.