Package com.spotfire.ws.im.ds.sql
Interface SQLFilter
- All Known Implementing Classes:
BasicSQLFilter
public interface SQLFilter
This interface should be used when full control over the SQL syntax is required. An implementation of this class can be specified in a data source template.
- Since:
- 3.0
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionformatCatalogName
(String name) Formats a catalog name.formatColumn
(String column, String tableAlias) Formats a column expression used in a SELECT, WHERE, GROUP BY or HAVING clause.formatColumnAlias
(String name) Formats a column alias to be used in a SELECT clause.formatColumnList
(String[] columns, String[] types) Returns SQL for a list column list in a CREATE TABLE statement.formatColumnName
(String name) Formats a column name.formatConditionExpression
(String expr, Class type) Formats a condition expression to be used in a WHERE clause.String[]
formatCreateTableSQL
(String table, String[] columns, String[] types) Returns SQL for creating a temporary table.String[]
formatDropTableSQL
(String table) Returns SQL for dropping a temporary table.formatHints
(String query, String[] hints) Formats an SQL query to include hints.formatInsertValuesSQL
(String table, String[] values) Return the SQL for inserting a row into a temporary table.formatLiteral
(String literal, Class type) formatProcedure
(String catalog, String schema, String procedure) Returns the SQL for a procedure expression in a FROM clause.formatQuery
(String query, List preCommands, List postCommands) Formats an SQL query.formatSchemaName
(String name) Formats a schema name.formatTable
(String catalog, String schema, String table) Returns the SQL for a table expression in a FROM clause.formatTableName
(String name) Formats a table name.formatTempTableName
(String name) Formats a temporary table name.Returns theJDBCContext
.getSQLAggregateFuntion
(String datAggregateFuntion) getSQLType
(Class type, int length) Returns the SQL type for a given Java type.void
setContext
(JDBCContext context) Sets theJDBCContext
.
-
Method Details
-
setContext
Sets theJDBCContext
.- Parameters:
context
- aJDBCContext
instance- Since:
- 3.0
-
getContext
JDBCContext getContext()Returns theJDBCContext
.- Returns:
- a
JDBCContext
instance - Since:
- 3.0
-
formatCreateTableSQL
Returns SQL for creating a temporary table.- Parameters:
table
- a table namecolumns
- a list of column namestypes
- a list of column types- Returns:
- a list of SQL commands
- Since:
- 3.0
- See Also:
-
formatDropTableSQL
Returns SQL for dropping a temporary table.- Parameters:
table
- a table name- Returns:
- a list of SQL commands
- Since:
- 3.0
-
formatInsertValuesSQL
Return the SQL for inserting a row into a temporary table.- Parameters:
table
- a table namevalues
- a list of values, may be?
for a prepared statement- Returns:
- an SQL command
- Since:
- 3.0
-
formatColumnList
Returns SQL for a list column list in a CREATE TABLE statement.- Parameters:
columns
- a list of column namestypes
- a list of column types- Returns:
- an SQL column list
- Since:
- 3.0
- See Also:
-
getSQLType
Returns the SQL type for a given Java type.- Parameters:
type
- a Java typelength
- the length whentype
isString
- Returns:
- an SQL type
- Since:
- 3.0
- See Also:
-
getSQLAggregateFuntion
- Parameters:
datAggregateFuntion
- datAggregateFunction- Returns:
- Returns the SQL aggregate function that maps to the given DAT aggregate function, or null if no mapping exists.
- Since:
- 3.0
-
formatTable
Returns the SQL for a table expression in a FROM clause.- Parameters:
catalog
- a catalog name, may benull
schema
- a schema name, may benull
table
- a table name- Returns:
- an SQL table expression
- Since:
- 3.0
- See Also:
-
formatProcedure
Returns the SQL for a procedure expression in a FROM clause.- Parameters:
catalog
- a catalog name, may benull
schema
- a schema name, may benull
procedure
- a procedure name- Returns:
- an SQL procedure expression
- Since:
- 3.0
- See Also:
-
formatColumn
Formats a column expression used in a SELECT, WHERE, GROUP BY or HAVING clause.- Parameters:
column
- a column nametableAlias
- a table alias- Returns:
- an SQL column expression
- Since:
- 3.0
- See Also:
-
formatColumnName
Formats a column name.- Parameters:
name
- a column name- Returns:
- an SQL column name
- Since:
- 3.0
- See Also:
-
formatTableName
Formats a table name.- Parameters:
name
- a table name- Returns:
- an SQL table name
- Since:
- 3.0
- See Also:
-
formatTempTableName
Formats a temporary table name.- Parameters:
name
- a table name- Returns:
- an SQL table name
- Since:
- 3.0
- See Also:
-
formatSchemaName
Formats a schema name.- Parameters:
name
- a schema name- Returns:
- an SQL schema name
- Since:
- 3.0
- See Also:
-
formatCatalogName
Formats a catalog name.- Parameters:
name
- a catalog name- Returns:
- an SQL catalog name
- Since:
- 3.0
- See Also:
-
formatColumnAlias
Formats a column alias to be used in a SELECT clause.- Parameters:
name
- a column alias- Returns:
- an SQL column alias
- Since:
- 3.0
- See Also:
-
formatLiteral
- Parameters:
literal
- a literal expressiontype
- a column type- Returns:
- Formats a literal to be used in a WHERE clause.
- Since:
- 3.0
- See Also:
-
formatConditionExpression
Formats a condition expression to be used in a WHERE clause.- Parameters:
expr
- a condition expressiontype
- a column type- Returns:
- an SQL condition expression
- Since:
- 3.0
- See Also:
-
formatHints
Formats an SQL query to include hints.- Parameters:
query
- an SQL queryhints
- a list of hints- Returns:
- an SQL query
- Since:
- 3.0
-
formatQuery
Formats an SQL query. This method is called as a the last step when building an SQL query.- Parameters:
query
- an SQL querypreCommands
- add to this list any commands to be executed before the querypostCommands
- add to this list any commands to be executed after the query- Returns:
- an SQL query
- Since:
- 3.0
-