|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.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. |
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 Platform
schemaType
- the Torque type, not null.
Platform.getSqlTypeForSchemaType(SchemaType)
public String getNullString(boolean notNull)
getNullString
in interface Platform
Platform.getNullString(boolean)
public String getAutoIncrement()
getAutoIncrement
in interface Platform
Platform.getAutoIncrement()
public boolean hasScale(String sqlType)
Platform
hasScale
in interface Platform
sqlType
- the SQL type
TODO collect info for all platforms
public boolean hasSize(String sqlType)
Platform
hasSize
in interface Platform
sqlType
- the SQL type
TODO collect info for all platforms
public String getSizeSuffix(String sqlType)
getSizeSuffix
in interface Platform
sqlType
- the SQL type to determine the suffix for.
public boolean createNotNullBeforeAutoincrement()
Platform
createNotNullBeforeAutoincrement
in interface Platform
Platform.createNotNullBeforeAutoincrement()
public String quoteAndEscape(String text)
Platform
quoteAndEscape
in interface Platform
text
- The string to escape, or null.
Platform.quoteAndEscape(String)
protected boolean escapeBackslashes()
public String getDateString(Date date)
getDateString
in interface Platform
date
- the date to format.
public String getTimeString(Date date)
getTimeString
in interface Platform
date
- the date to format.
public String getTimestampString(Date date)
getTimestampString
in interface Platform
date
- the date to format.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |