public class PlatformDefaultImpl extends Object implements Platform
| Constructor and Description |
|---|
PlatformDefaultImpl()
Default constructor.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
createNotNullBeforeAutoincrement()
Returns whether the "not null part" of the definition of a column
should be generated before the "autoincrement part" in a "create table"
statement.
|
protected boolean |
escapeBackslashes()
Returns whether backslashes must be escaped in string literals.
|
protected String |
formatDateTimeString(Date date,
String format)
Helper function to format date values to a platform-specific string
|
String |
getAutoIncrement() |
String |
getDateString(Date date)
Formats the given date as date string which is parseable by the database.
|
String |
getNullString(boolean notNull) |
String |
getSizeSuffix(String sqlType)
Returns a possible SQL suffix for column definitions of certain
SQL Types, e.g.
|
SqlType |
getSqlTypeForSchemaType(SchemaType schemaType)
Returns the db specific SQL type for a Torque type.
|
String |
getTimestampString(Date date)
Formats the given date as timestamp string which is parseable
by the database.
|
String |
getTimeString(Date date)
Formats the given date as time string which is parseable by the database.
|
boolean |
hasScale(String sqlType)
Returns if the RDBMS-specific SQL type has a scale attribute.
|
boolean |
hasSize(String sqlType)
Returns if the RDBMS-specific SQL type has a size attribute.
|
boolean |
hasUniqueConstraintSize()
Returns whether the database has schema support unique constraint
for columns with size
|
String |
quoteAndEscape(String text)
Quotes and escapes a string such that it can be used
as literal String value in SQL.
|
protected void |
setSchemaTypeToSqlTypeMapping(SchemaType schemaType,
SqlType sqlType)
Adds a mapping to the torque schema type -> sql type map.
|
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.
|
protected void setSchemaTypeToSqlTypeMapping(SchemaType schemaType, SqlType sqlType)
schemaType - the torque schema type which should be mapped,
not null.sqlType - the sql type for the torque schema type, not null.protected String formatDateTimeString(Date date, String format)
date - the Date objectformat - the format stringpublic SqlType getSqlTypeForSchemaType(SchemaType schemaType)
PlatformgetSqlTypeForSchemaType in interface PlatformschemaType - the Torque type, not null.Platform.getSqlTypeForSchemaType(SchemaType)public String getNullString(boolean notNull)
getNullString in interface PlatformnotNull - flag for not nullPlatform.getNullString(boolean)public String getAutoIncrement()
getAutoIncrement in interface PlatformPlatform.getAutoIncrement()public boolean hasScale(String sqlType)
PlatformhasScale in interface PlatformsqlType - the SQL typeTODO collect info for all platformspublic boolean hasSize(String sqlType)
PlatformhasSize in interface PlatformsqlType - the SQL typeTODO collect info for all platformspublic String getSizeSuffix(String sqlType)
getSizeSuffix in interface PlatformsqlType - the SQL type to determine the suffix for.public boolean createNotNullBeforeAutoincrement()
PlatformcreateNotNullBeforeAutoincrement in interface PlatformPlatform.createNotNullBeforeAutoincrement()public String quoteAndEscape(String text)
PlatformquoteAndEscape in interface Platformtext - The string to escape, or null.Platform.quoteAndEscape(String)protected boolean escapeBackslashes()
public String getDateString(Date date)
getDateString in interface Platformdate - the date to format.public String getTimeString(Date date)
getTimeString in interface Platformdate - the date to format.public String getTimestampString(Date date)
getTimestampString in interface Platformdate - the date to format.public boolean usesStandaloneSchema()
usesStandaloneSchema in interface Platformpublic boolean hasUniqueConstraintSize()
PlatformhasUniqueConstraintSize in interface PlatformCopyright © 2000–2020 The Apache Software Foundation. All rights reserved.