|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.partnersoft.sql.GenericSqlDialect
public class GenericSqlDialect
Generic SqlDialect. Ignores any operation that is type specific.
Any type specific behavior should be put in a database specific Dialect class, and added to SqlType for the correct type's getDialect().
Copyright 2009 Partner Software, Inc.
| Constructor Summary | |
|---|---|
GenericSqlDialect()
|
|
| Method Summary | |
|---|---|
java.lang.String |
addColumn(java.lang.String tableName,
CogStructureField newField,
CogType newFieldType)
Returns complete Sql to add a column. |
java.lang.String |
alterColumn(java.lang.String tableName,
CogStructureField newField,
CogType newFieldType)
Returns complete Sql to alter a column. |
java.lang.String |
cogTypeToSqlType(CogType type)
Helper for converting from a CogType to a Sql flavor specific data type. |
protected java.lang.String |
constantToSql(java.lang.String fieldValueType,
java.lang.Object value)
Helper for controlling how constant values of where clauses are writing in Sql. |
java.lang.String |
createTable(CogSchema schema,
CogStructureType tableType)
Returns complete Sql create table statement. |
java.lang.String |
dropColumn(java.lang.String tableName,
java.lang.String fieldName)
Returns complete Sql to drop a column. |
protected java.lang.String |
handleSorts(java.util.List<DataFilterSort> sorts)
Helper method. |
protected java.lang.String |
listFields(java.util.List<java.lang.String> fields)
Helper method. |
protected java.lang.String |
parseFilter(DataFilterExpression filter,
CogStructureType type)
Recursive helper for parsing DataFilterExpressions into sql. |
java.lang.String |
selectSql(DataRecordQuery query,
CogStructureType tableType)
Returns complete Sql select statement. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public GenericSqlDialect()
| Method Detail |
|---|
protected java.lang.String parseFilter(DataFilterExpression filter,
CogStructureType type)
filter - - DataFilterExpression to parse for Sql.type - - CogStructureType defining the fields in filter.
protected java.lang.String constantToSql(java.lang.String fieldValueType,
java.lang.Object value)
fieldValueType - - CogStructureField's value type for this field.value - - Value to covert to String for Sql.
public java.lang.String cogTypeToSqlType(CogType type)
SqlDialect
cogTypeToSqlType in interface SqlDialecttype - - CogType to convert to Sql type.
protected java.lang.String listFields(java.util.List<java.lang.String> fields)
fields -
protected java.lang.String handleSorts(java.util.List<DataFilterSort> sorts)
sorts -
public java.lang.String selectSql(DataRecordQuery query,
CogStructureType tableType)
SqlDialect
selectSql in interface SqlDialectquery - - Query describing select statement.tableType - - CogStructureType defining table. Type name is assumed to be table name.
public java.lang.String createTable(CogSchema schema,
CogStructureType tableType)
SqlDialect
createTable in interface SqlDialectschema - - Schema defining column types.tableType - - CogStructureType defining table. Type name is assumed to be table name.
public java.lang.String addColumn(java.lang.String tableName,
CogStructureField newField,
CogType newFieldType)
SqlDialect
addColumn in interface SqlDialecttableName - - Name of table to add a column to.newField - - Field to add.newFieldType - - CogType of field to add.
public java.lang.String alterColumn(java.lang.String tableName,
CogStructureField newField,
CogType newFieldType)
SqlDialect
alterColumn in interface SqlDialecttableName - - Name of table to alter column in.newField - - Field to change.newFieldType - - CogType for the passed field.
public java.lang.String dropColumn(java.lang.String tableName,
java.lang.String fieldName)
SqlDialect
dropColumn in interface SqlDialecttableName - - Name of table to drop column from.fieldName - - Name of field to drop.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||