|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.torque.templates.platform.PlatformDefaultImpl
public class PlatformDefaultImpl
Default implementation for the Platform interface.
| Constructor Summary | |
|---|---|
PlatformDefaultImpl()
Default constructor. |
|
| Method Summary | |
|---|---|
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. |
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. |
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. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public PlatformDefaultImpl()
| Method Detail |
|---|
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.public SqlType getSqlTypeForSchemaType(SchemaType schemaType)
Platform
getSqlTypeForSchemaType in interface PlatformschemaType - the Torque type, not null.
Platform.getSqlTypeForSchemaType(SchemaType)public String getNullString(boolean notNull)
getNullString in interface PlatformPlatform.getNullString(boolean)public String getAutoIncrement()
getAutoIncrement in interface PlatformPlatform.getAutoIncrement()public boolean hasScale(String sqlType)
Platform
hasScale in interface PlatformsqlType - the SQL type
TODO collect info for all platformspublic boolean hasSize(String sqlType)
Platform
hasSize in interface PlatformsqlType - the SQL type
TODO collect info for all platformspublic String getSizeSuffix(String sqlType)
getSizeSuffix in interface PlatformsqlType - the SQL type to determine the suffix for.
public boolean createNotNullBeforeAutoincrement()
Platform
createNotNullBeforeAutoincrement in interface PlatformPlatform.createNotNullBeforeAutoincrement()public String quoteAndEscape(String text)
Platform
quoteAndEscape 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 Platform
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||