org.apache.torque.engine.platform
Interface Platform

All Known Implementing Classes:
PlatformDefaultImpl, PlatformMysqlImpl, PlatformOracleImpl

public interface Platform

Interface for RDBMS platform specific behaviour.

Version:
$Id: Platform.java,v 1.1.6.2 2008-04-18 17:04:37 jkeller Exp $
Author:
Martin Poeschl

Field Summary
static String IDENTITY
          constant for native id method
static String SEQUENCE
          constant for native id method
 
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.
 String filterInvalidDefaultValues(String defaultValue)
           
 String getAutoIncrement()
           
 Domain getDomainForSchemaType(SchemaType jdbcType)
          Returns the db specific domain for a jdbcType.
 int getMaxColumnNameLength()
          Returns the max column length supported by the db.
 String getNativeIdMethod()
          Returns the native IdMethod (sequence|identity)
 String getNullString(boolean notNull)
           
 List<String> getPrimaryKeys(DatabaseMetaData dbMeta, String dbSchema, String tableName)
           
 String getSchemaName(String artifactId)
          Given an artifact id, return a string a schema name based on the artifact id that is allowed by the db vendor
 List<String> getSequenceNames(DatabaseMetaData dbMetaData, String databaseSchema)
          Get the list of sequences defined in the database schema given.
 Long getSequenceNextVal(Connection con, String schema, String sequenceName)
           
 String getServerUrl(String url)
          Given a JDBC url return a url that can connect directly to the database server itself.
 List<String> getTableNames(DatabaseMetaData dbMeta, String databaseSchema)
           
 String getViewDefinition(Connection con, String schema, String viewName)
           
 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 isSpecialDefault(String defaultValue)
           
 

Field Detail

IDENTITY

static final String IDENTITY
constant for native id method

See Also:
Constant Field Values

SEQUENCE

static final String SEQUENCE
constant for native id method

See Also:
Constant Field Values
Method Detail

getServerUrl

String getServerUrl(String url)
Given a JDBC url return a url that can connect directly to the database server itself. ie no database specified


getSchemaName

String getSchemaName(String artifactId)
Given an artifact id, return a string a schema name based on the artifact id that is allowed by the db vendor


getNativeIdMethod

String getNativeIdMethod()
Returns the native IdMethod (sequence|identity)

Returns:
the native IdMethod

getMaxColumnNameLength

int getMaxColumnNameLength()
Returns the max column length supported by the db.

Returns:
the max column length

getDomainForSchemaType

Domain getDomainForSchemaType(SchemaType jdbcType)
Returns the db specific domain for a jdbcType.

Parameters:
jdbcType - the jdbcType name
Returns:
the db specific domain

getNullString

String getNullString(boolean notNull)
Returns:
The RDBMS-specific SQL fragment for NULL or NOT NULL.

getAutoIncrement

String getAutoIncrement()
Returns:
The RDBMS-specific SQL fragment for autoincrement.

hasSize

boolean hasSize(String sqlType)
Returns if the RDBMS-specific SQL type has a size attribute.

Parameters:
sqlType - the SQL type
Returns:
true if the type has a size attribute

hasScale

boolean hasScale(String sqlType)
Returns if the RDBMS-specific SQL type has a scale attribute.

Parameters:
sqlType - the SQL type
Returns:
true if the type has a scale attribute

createNotNullBeforeAutoincrement

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.

Returns:
true if the "not null part" should be first, false if the "autoincrement part" should be first in a "create table" statement.

filterInvalidDefaultValues

String filterInvalidDefaultValues(String defaultValue)

isSpecialDefault

boolean isSpecialDefault(String defaultValue)

getViewDefinition

String getViewDefinition(Connection con,
                         String schema,
                         String viewName)

getSequenceNextVal

Long getSequenceNextVal(Connection con,
                        String schema,
                        String sequenceName)

getPrimaryKeys

List<String> getPrimaryKeys(DatabaseMetaData dbMeta,
                            String dbSchema,
                            String tableName)
                            throws SQLException
Throws:
SQLException

getTableNames

List<String> getTableNames(DatabaseMetaData dbMeta,
                           String databaseSchema)
                           throws SQLException
Throws:
SQLException

getSequenceNames

List<String> getSequenceNames(DatabaseMetaData dbMetaData,
                              String databaseSchema)
                              throws SQLException
Get the list of sequences defined in the database schema given.

Parameters:
dbMetaData -
databaseSchema -
Returns:
A list of sequences that exist in the database.
Throws:
SQLException


Copyright © 2004-2013 The Kuali Foundation. All Rights Reserved.