org.apache.torque.templates.platform
Class PlatformOracleImpl

java.lang.Object
  extended by org.apache.torque.templates.platform.PlatformDefaultImpl
      extended by org.apache.torque.templates.platform.PlatformOracleImpl
All Implemented Interfaces:
Platform

public class PlatformOracleImpl
extends PlatformDefaultImpl

Oracle Platform implementation.

Version:
$Id: PlatformOracleImpl.java 1439173 2013-01-27 20:42:51Z tfischer $
Author:
Martin Poeschl

Constructor Summary
PlatformOracleImpl()
          Default constructor.
 
Method Summary
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 getSizeSuffix(String sqlType)
          Returns a possible SQL suffix for column definitions of certain SQL Types, e.g.
 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 hasSize(String sqlType)
          Returns if the RDBMS-specific SQL type has a size attribute.
 
Methods inherited from class org.apache.torque.templates.platform.PlatformDefaultImpl
createNotNullBeforeAutoincrement, getNullString, getSqlTypeForSchemaType, hasScale, quoteAndEscape, setSchemaTypeToSqlTypeMapping, usesStandaloneSchema
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PlatformOracleImpl

public PlatformOracleImpl()
Default constructor.

Method Detail

getAutoIncrement

public String getAutoIncrement()
Specified by:
getAutoIncrement in interface Platform
Overrides:
getAutoIncrement in class PlatformDefaultImpl
Returns:
The RDBMS-specific SQL fragment for autoincrement.
See Also:
Platform.getAutoIncrement()

escapeBackslashes

protected boolean escapeBackslashes()
Description copied from class: PlatformDefaultImpl
Returns whether backslashes must be escaped in string literals.

Overrides:
escapeBackslashes in class PlatformDefaultImpl
Returns:
true if backslashes bust be escaped, false otherwise.

getSizeSuffix

public String getSizeSuffix(String sqlType)
Returns a possible SQL suffix for column definitions of certain SQL Types, e.g. for Oracle VARCHAR2 columns, it typically makes sense to use 'x CHAR' instead of 'x' as size.

Specified by:
getSizeSuffix in interface Platform
Overrides:
getSizeSuffix in class PlatformDefaultImpl
Parameters:
sqlType - the SQL type to determine the suffix for.
Returns:
The size suffix, not null. This implementation always returns the empty string.

getDateString

public String getDateString(Date date)
Formats the given date as date string which is parseable by the database.

Specified by:
getDateString in interface Platform
Overrides:
getDateString in class PlatformDefaultImpl
Parameters:
date - the date to format.
Returns:
the date string, inclusive string escaping.

getTimeString

public String getTimeString(Date date)
Formats the given date as time string which is parseable by the database.

Specified by:
getTimeString in interface Platform
Overrides:
getTimeString in class PlatformDefaultImpl
Parameters:
date - the date to format.
Returns:
the time string, inclusive string escaping.

getTimestampString

public String getTimestampString(Date date)
Formats the given date as timestamp string which is parseable by the database.

Specified by:
getTimestampString in interface Platform
Overrides:
getTimestampString in class PlatformDefaultImpl
Parameters:
date - the date to format.
Returns:
the timestamp string, inclusive string escaping.

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 interface Platform
Overrides:
hasSize in class PlatformDefaultImpl
Parameters:
sqlType - the SQL type
Returns:
true if the type has a size attribute
See Also:
Platform.hasSize(String)


Copyright © 2000-2013 The Apache Software Foundation. All Rights Reserved.