Class SQLGenerator
java.lang.Object
com.invirgance.convirgance.olap.sql.SQLGenerator
Provides support for creating and outputting SQL queries for working
with OLAP.
- Author:
- jbanes
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
addAggregate
(String function, String column, Table table) Adds an Aggregate object into the list of Columns selected for this SQLGenerator.void
addAggregate
(String function, String column, Table table, String alias) Adds an Aggregate object (with specified alias) into the list of Columns selected for this SQLGenerator.void
Adds a Column object into the list of Columns selected for this SQLGenerator.void
Adds a Column object with the specified alias name into the list of Columns for this SQL Generator.void
Adds the provided Table to the table list of the SQLGeneratorgetSQL()
Generates the String with the full SQL query.boolean
Returns true if the SQLGenerator is case sensitive.boolean
Returns true if the SQLGenerator is set to force the GROUP BY command in queries, false otherwise.void
setCaseSensitive
(boolean caseSensitive) Sets the case sensitivity for the SQLGenerator as true or false.void
setForceGroupBy
(boolean forceGroupBy) Sets the forcing of GROUP BY command.
-
Constructor Details
-
SQLGenerator
public SQLGenerator()
-
-
Method Details
-
isCaseSensitive
public boolean isCaseSensitive()Returns true if the SQLGenerator is case sensitive.- Returns:
- boolean.
-
setCaseSensitive
public void setCaseSensitive(boolean caseSensitive) Sets the case sensitivity for the SQLGenerator as true or false.- Parameters:
caseSensitive
- boolean value.
-
isForceGroupBy
public boolean isForceGroupBy()Returns true if the SQLGenerator is set to force the GROUP BY command in queries, false otherwise.- Returns:
- boolean.
-
setForceGroupBy
public void setForceGroupBy(boolean forceGroupBy) Sets the forcing of GROUP BY command.- Parameters:
forceGroupBy
- boolean.
-
addTable
Adds the provided Table to the table list of the SQLGenerator- Parameters:
table
- a Table to include in SQLGenerator.
-
addSelect
Adds a Column object into the list of Columns selected for this SQLGenerator.- Parameters:
column
- String with the column name to be added.table
- Table associated with the column.
-
addSelect
Adds a Column object with the specified alias name into the list of Columns for this SQL Generator. The Column is constructed using string name provided, the associated table, and the specified alias.- Parameters:
column
- the string with the column name.table
- Table associated with the column.alias
- the string representing the alias for the column name.
-
addAggregate
Adds an Aggregate object into the list of Columns selected for this SQLGenerator.- Parameters:
function
- the aggregate's function.column
- the aggregate's name.table
- table associated with the aggregate.
-
addAggregate
Adds an Aggregate object (with specified alias) into the list of Columns selected for this SQLGenerator.- Parameters:
function
- the aggregate's function.column
- the aggregate's name.table
- table associated with the aggregate.alias
- the aggregate's alias.
-
getSQL
Generates the String with the full SQL query.- Returns:
- the SQL query string
-