com.partnersoft.sql
Class MySqlDialect

java.lang.Object
  extended by com.partnersoft.sql.GenericSqlDialect
      extended by com.partnersoft.sql.MySqlDialect
All Implemented Interfaces:
Lib, SqlDialect

public class MySqlDialect
extends GenericSqlDialect

SqlDialect for MySql databases.

Copyright 2010 Partner Software, Inc.

Version:
$Id$
Author:
Rich Stepanski

Constructor Summary
MySqlDialect()
           
 
Method Summary
 java.lang.String cogTypeToSqlType(CogType type)
          Helper for converting from a CogType to a Sql flavor specific data type.
 java.lang.String createTable(CogSchema schema, CogStructureType tableType)
          Returns complete Sql create table statement.
 java.lang.String selectSql(DataRecordQuery query, CogStructureType tableType)
          Returns complete Sql select statement.
 
Methods inherited from class com.partnersoft.sql.GenericSqlDialect
addColumn, alterColumn, constantToSql, dropColumn, handleSorts, listFields, parseFilter
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MySqlDialect

public MySqlDialect()
Method Detail

selectSql

public java.lang.String selectSql(DataRecordQuery query,
                                  CogStructureType tableType)
Description copied from interface: SqlDialect
Returns complete Sql select statement.

Specified by:
selectSql in interface SqlDialect
Overrides:
selectSql in class GenericSqlDialect
Parameters:
query - - Query describing select statement.
tableType - - CogStructureType defining table. Type name is assumed to be table name.
Returns:
Sql select statement for passed query.

cogTypeToSqlType

public java.lang.String cogTypeToSqlType(CogType type)
Description copied from interface: SqlDialect
Helper for converting from a CogType to a Sql flavor specific data type. Default returns the CogPrimitiveType's sqlType, or VARCHAR(255)

Specified by:
cogTypeToSqlType in interface SqlDialect
Overrides:
cogTypeToSqlType in class GenericSqlDialect
Parameters:
type - - CogType to convert to Sql type.
Returns:
Sql flavor specific data type for the passed cog type.

createTable

public java.lang.String createTable(CogSchema schema,
                                    CogStructureType tableType)
Description copied from interface: SqlDialect
Returns complete Sql create table statement.

Specified by:
createTable in interface SqlDialect
Overrides:
createTable in class GenericSqlDialect
Parameters:
schema - - Schema defining column types.
tableType - - CogStructureType defining table. Type name is assumed to be table name.
Returns:
Sql create table statement for passed schema and cog type.