com.j256.ormlite.db
Class SqlServerDatabaseType

java.lang.Object
  extended by com.j256.ormlite.db.BaseDatabaseType
      extended by com.j256.ormlite.db.SqlServerDatabaseType
All Implemented Interfaces:
DatabaseType
Direct Known Subclasses:
SqlServerJtdsDatabaseType

public class SqlServerDatabaseType
extends BaseDatabaseType
implements DatabaseType

Microsoft SQL server database type information used to create the tables, etc..

WARNING: I have not tested this unfortunately because of a lack of permanent access to a MSSQL instance.

Author:
graywatson

Nested Class Summary
 
Nested classes/interfaces inherited from class com.j256.ormlite.db.BaseDatabaseType
BaseDatabaseType.BooleanNumberFieldConverter
 
Field Summary
 
Fields inherited from class com.j256.ormlite.db.BaseDatabaseType
booleanConverter
 
Constructor Summary
SqlServerDatabaseType()
           
 
Method Summary
protected  void appendBooleanType(StringBuilder sb)
          Output the SQL type for a Java boolean.
protected  void appendByteType(StringBuilder sb)
          Output the SQL type for a Java byte.
protected  void appendDateType(StringBuilder sb)
          Output the SQL type for a Java Date.
 void appendEscapedEntityName(StringBuilder sb, String word)
          Add a entity-name word to the string builder wrapped in the proper characters to escape it.
 void appendLimitValue(StringBuilder sb, int limit)
          Append to the string builder the necessary SQL to limit the results to a certain number.
protected  void appendObjectType(StringBuilder sb)
          Output the SQL type for a Java object.
protected  void configureGeneratedId(StringBuilder sb, FieldType fieldType, List<String> statementsBefore, List<String> additionalArgs, List<String> queriesAfter)
          Output the SQL necessary to configure a generated-id column.
 String getDriverClassName()
          Return the class name of the database driver.
 String getDriverUrlPart()
          Return the part in the database URI which identifies the particular database.
 FieldConverter getFieldConverter(FieldType fieldType)
          Return the FieldConverter to associate with the FieldType.
 boolean isLimitAfterSelect()
          Return true if the LIMIT should be called after SELECT otherwise at the end of the WHERE (the default).
 
Methods inherited from class com.j256.ormlite.db.BaseDatabaseType
appendCanBeNull, appendColumnArg, appendCreateTableSuffix, appendDefaultValue, appendDoubleType, appendEnumIntType, appendEnumStringType, appendEscapedWord, appendFloatType, appendIntegerType, appendLongType, appendSelectNextValFromSequence, appendShortType, appendStringType, buildDatabaseAccess, configureGeneratedIdSequence, configureId, convertColumnName, dropColumnArg, generateIdSequenceName, getCommentLinePrefix, getDefaultVarcharWidth, isCreateTableReturnsZero, isEntityNamesMustBeUpCase, isIdSequenceNeeded, isLimitSqlSupported, isVarcharFieldWidthSupported, loadDriver
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.j256.ormlite.db.DatabaseType
appendColumnArg, appendCreateTableSuffix, appendEscapedWord, appendSelectNextValFromSequence, buildDatabaseAccess, convertColumnName, dropColumnArg, generateIdSequenceName, getCommentLinePrefix, isCreateTableReturnsZero, isEntityNamesMustBeUpCase, isIdSequenceNeeded, isLimitSqlSupported, isVarcharFieldWidthSupported, loadDriver
 

Constructor Detail

SqlServerDatabaseType

public SqlServerDatabaseType()
Method Detail

getDriverUrlPart

public String getDriverUrlPart()
Description copied from interface: DatabaseType
Return the part in the database URI which identifies the particular database. Usually the URI is in the form jdbc:ddd:... where ddd is the driver url part.

Specified by:
getDriverUrlPart in interface DatabaseType

getDriverClassName

public String getDriverClassName()
Description copied from interface: DatabaseType
Return the class name of the database driver.

Specified by:
getDriverClassName in interface DatabaseType

getFieldConverter

public FieldConverter getFieldConverter(FieldType fieldType)
Description copied from interface: DatabaseType
Return the FieldConverter to associate with the FieldType. This allows the database instance to convert a field as necessary before it goes to the database.

Specified by:
getFieldConverter in interface DatabaseType
Overrides:
getFieldConverter in class BaseDatabaseType

appendBooleanType

protected void appendBooleanType(StringBuilder sb)
Description copied from class: BaseDatabaseType
Output the SQL type for a Java boolean.

Overrides:
appendBooleanType in class BaseDatabaseType

appendByteType

protected void appendByteType(StringBuilder sb)
Description copied from class: BaseDatabaseType
Output the SQL type for a Java byte.

Overrides:
appendByteType in class BaseDatabaseType

appendDateType

protected void appendDateType(StringBuilder sb)
Description copied from class: BaseDatabaseType
Output the SQL type for a Java Date.

Overrides:
appendDateType in class BaseDatabaseType

appendObjectType

protected void appendObjectType(StringBuilder sb)
Description copied from class: BaseDatabaseType
Output the SQL type for a Java object.

Overrides:
appendObjectType in class BaseDatabaseType

configureGeneratedId

protected void configureGeneratedId(StringBuilder sb,
                                    FieldType fieldType,
                                    List<String> statementsBefore,
                                    List<String> additionalArgs,
                                    List<String> queriesAfter)
Description copied from class: BaseDatabaseType
Output the SQL necessary to configure a generated-id column. This may add to the before statements list or additional arguments later. NOTE: Only one of configureGeneratedIdSequence, configureGeneratedId, or configureId will be called.

Overrides:
configureGeneratedId in class BaseDatabaseType

appendEscapedEntityName

public void appendEscapedEntityName(StringBuilder sb,
                                    String word)
Description copied from interface: DatabaseType
Add a entity-name word to the string builder wrapped in the proper characters to escape it. This avoids problems with table, column, and sequence-names being reserved words.

Specified by:
appendEscapedEntityName in interface DatabaseType
Overrides:
appendEscapedEntityName in class BaseDatabaseType

isLimitAfterSelect

public boolean isLimitAfterSelect()
Description copied from interface: DatabaseType
Return true if the LIMIT should be called after SELECT otherwise at the end of the WHERE (the default).

Specified by:
isLimitAfterSelect in interface DatabaseType
Overrides:
isLimitAfterSelect in class BaseDatabaseType

appendLimitValue

public void appendLimitValue(StringBuilder sb,
                             int limit)
Description copied from interface: DatabaseType
Append to the string builder the necessary SQL to limit the results to a certain number.

Specified by:
appendLimitValue in interface DatabaseType
Overrides:
appendLimitValue in class BaseDatabaseType


Copyright © 2010. All Rights Reserved.