org.kuali.rice.core.framework.persistence.platform
Class ANSISqlDatabasePlatform

java.lang.Object
  extended by org.kuali.rice.core.framework.persistence.platform.ANSISqlDatabasePlatform
All Implemented Interfaces:
DatabasePlatform
Direct Known Subclasses:
DerbyDatabasePlatform, MySQLDatabasePlatform, OracleDatabasePlatform

public abstract class ANSISqlDatabasePlatform
extends Object
implements DatabasePlatform


Constructor Summary
ANSISqlDatabasePlatform()
           
 
Method Summary
 String getCreateTableFromTableSql(String tableToCreate, String fromTable)
           
 String getDateSQL(String date, String time)
          Supplies the sql for a given date string that will satisfy a where clause
 String getDropTableSql(String tableName)
           
 String getInsertDataFromTableSql(String restoreTableName, String fromTableName)
           
 String getIsNullFunction(String exprToTest, String exprToReplaceIfTestExprNull)
          Returns an expression equivalent to oracle's NVL statement using the CASE and IS NULL expressions, which should be supported by many database systems
 String getTruncateTableSql(String tableName)
           
 String getUpperCaseFunction()
          Returns the name of a function for shifting a string to uppercase on the relevant platform.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.kuali.rice.core.framework.persistence.platform.DatabasePlatform
applyLimit, escapeString, getCurTimeFunction, getDateFormatString, getLockRouteHeaderQuerySQL, getNextValSQL, getNextValSQL, getSelectForUpdateSuffix, getStrToDateFunction
 

Constructor Detail

ANSISqlDatabasePlatform

public ANSISqlDatabasePlatform()
Method Detail

getTruncateTableSql

public String getTruncateTableSql(String tableName)
Specified by:
getTruncateTableSql in interface DatabasePlatform
Parameters:
tableName - the name of the table to be truncated
Returns:
a String of SQL for truncating a table
See Also:
DatabasePlatform.getTruncateTableSql(String)

getCreateTableFromTableSql

public String getCreateTableFromTableSql(String tableToCreate,
                                         String fromTable)
Specified by:
getCreateTableFromTableSql in interface DatabasePlatform
Parameters:
tableToCreate - the String name for the table to be created
fromTable - the String name of the original table
Returns:
the SQL string for creating the specified table from the second specified table
See Also:
DatabasePlatform.getCreateTableFromTableSql(String, String)

getInsertDataFromTableSql

public String getInsertDataFromTableSql(String restoreTableName,
                                        String fromTableName)
Specified by:
getInsertDataFromTableSql in interface DatabasePlatform
Returns:
an "INSERT INTO" SQL command
See Also:
DatabasePlatform.getInsertDataFromTableSql(String, String)

getDropTableSql

public String getDropTableSql(String tableName)
Specified by:
getDropTableSql in interface DatabasePlatform
Parameters:
tableName - the table to drop
Returns:
an SQL command for dropping the specified table
See Also:
DatabasePlatform.getDropTableSql(String)

getIsNullFunction

public String getIsNullFunction(String exprToTest,
                                String exprToReplaceIfTestExprNull)
Returns an expression equivalent to oracle's NVL statement using the CASE and IS NULL expressions, which should be supported by many database systems

Specified by:
getIsNullFunction in interface DatabasePlatform
Parameters:
exprToTest - a SQL expression that will either evaluate to null or non-null
exprToReplaceIfTestExprNull - the value to return if
Returns:
a SQL expression that acts like nvl on oracle or ifnull() on MySQL
See Also:
DatabasePlatform.getIsNullFunction(java.lang.String, java.lang.String)

getDateSQL

public String getDateSQL(String date,
                         String time)
Description copied from interface: DatabasePlatform
Supplies the sql for a given date string that will satisfy a where clause

Specified by:
getDateSQL in interface DatabasePlatform
Parameters:
date - in YYYY/MM/DD format
time - in hh:mm:ss format
Returns:
the sql for a given date string that will satisfy a where clause
See Also:
SqlUtil#establishDateString(String, String, String, StringBuffer, DatabasePlatform), TODO: refactor to use a parsed Date object or milliseconds instead of date String

getUpperCaseFunction

public String getUpperCaseFunction()
Description copied from interface: DatabasePlatform
Returns the name of a function for shifting a string to uppercase on the relevant platform.

Specified by:
getUpperCaseFunction in interface DatabasePlatform
Returns:
the String "UPPER"
See Also:
DatabasePlatform.getUpperCaseFunction()

toString

public String toString()
Overrides:
toString in class Object


Copyright © 2005-2012 The Kuali Foundation. All Rights Reserved.