Class PlatformMssqlImpl
- java.lang.Object
-
- org.apache.torque.templates.platform.PlatformDefaultImpl
-
- org.apache.torque.templates.platform.PlatformMssqlImpl
-
- All Implemented Interfaces:
Platform
public class PlatformMssqlImpl extends PlatformDefaultImpl
MS SQL Platform implementation.- Version:
- $Id: PlatformMssqlImpl.java 1872379 2020-01-06 13:45:27Z tv $
- Author:
- Martin Poeschl, Greg Monroe
-
-
Constructor Summary
Constructors Constructor Description PlatformMssqlImpl()
Default constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected boolean
escapeBackslashes()
Returns whether backslashes must be escaped in string literals.String
getNullString(boolean notNull)
String
getTimestampString(Date date)
Formats the given date as timestamp string which is parseable by the database.boolean
hasSize(String sqlType)
Returns if the RDBMS-specific SQL type has a size attribute.boolean
usesStandaloneSchema()
Returns whether the database has schema support where a schema is not tied to a user (oracle) or database (mysql), but can be created separately.-
Methods inherited from class org.apache.torque.templates.platform.PlatformDefaultImpl
createNotNullBeforeAutoincrement, formatDateTimeString, getAutoIncrement, getDateString, getSizeSuffix, getSqlTypeForSchemaType, getTimeString, hasScale, hasUniqueConstraintSize, quoteAndEscape, setSchemaTypeToSqlTypeMapping
-
-
-
-
Method Detail
-
getNullString
public String getNullString(boolean notNull)
- Specified by:
getNullString
in interfacePlatform
- Overrides:
getNullString
in classPlatformDefaultImpl
- Parameters:
notNull
- flag for not null- Returns:
- Explicitly returns
NULL
if null values are allowed (as recomended by Microsoft). - See Also:
Platform.getNullString(boolean)
-
escapeBackslashes
protected boolean escapeBackslashes()
Description copied from class:PlatformDefaultImpl
Returns whether backslashes must be escaped in string literals.- Overrides:
escapeBackslashes
in classPlatformDefaultImpl
- Returns:
- true if backslashes bust be escaped, false otherwise.
-
getTimestampString
public String getTimestampString(Date date)
Formats the given date as timestamp string which is parseable by the database.- Specified by:
getTimestampString
in interfacePlatform
- Overrides:
getTimestampString
in classPlatformDefaultImpl
- Parameters:
date
- the date to format.- Returns:
- the timestamp string, inclusive string escaping.
-
usesStandaloneSchema
public boolean usesStandaloneSchema()
Returns whether the database has schema support where a schema is not tied to a user (oracle) or database (mysql), but can be created separately.- Specified by:
usesStandaloneSchema
in interfacePlatform
- Overrides:
usesStandaloneSchema
in classPlatformDefaultImpl
- Returns:
- this implementation returns true.
-
hasSize
public boolean hasSize(String sqlType)
Description copied from interface:Platform
Returns if the RDBMS-specific SQL type has a size attribute.- Specified by:
hasSize
in interfacePlatform
- Overrides:
hasSize
in classPlatformDefaultImpl
- Parameters:
sqlType
- the SQL type- Returns:
- true if the type has a size attribute
- See Also:
Platform.hasSize(String)
-
-