objective-c-sql-query-builder
Public Member Functions | Protected Attributes
ZIMSqlSelectStatement Class Reference

#import <ZIMSqlSelectStatement.h>

Inheritance diagram for ZIMSqlSelectStatement:
<ZIMSqlStatement> <ZIMSqlDataManipulationCommand>

List of all members.

Public Member Functions

(void) - distinct:
(void) - column:
(void) - column:alias:
(void) - from:
(void) - from:alias:
(void) - join:
(void) - join:alias:
(void) - join:type:
(void) - join:alias:type:
(void) - joinOn:operator:column:
(void) - joinOn:operator:column:connector:
(void) - joinOn:operator:value:
(void) - joinOn:operator:value:connector:
(void) - joinUsing:
(void) - whereBlock:
(void) - whereBlock:connector:
(void) - where:operator:column:
(void) - where:operator:column:connector:
(void) - where:operator:value:
(void) - where:operator:value:connector:
(void) - groupBy:
(void) - groupByHavingBlock:
(void) - groupByHavingBlock:connector:
(void) - groupByHaving:operator:column:
(void) - groupByHaving:operator:column:connector:
(void) - groupByHaving:operator:value:
(void) - groupByHaving:operator:value:connector:
(void) - orderBy:
(void) - orderBy:descending:
(void) - orderBy:nulls:
(void) - orderBy:descending:nulls:
(void) - limit:
(void) - limit:offset:
(void) - offset:
(void) - combine:operator:
(NSString *) - statement
(id) - init [implementation]

Protected Attributes

BOOL _distinct
NSMutableArray * _column
NSMutableArray * _table
NSMutableArray * _join
NSMutableArray * _where
NSMutableArray * _groupBy
NSMutableArray * _having
NSMutableArray * _orderBy
NSUInteger _limit
NSUInteger _offset
NSMutableArray * _combine

Detailed Description

Discussion:
This class represents an SQL select statement.
Updated:
2012-03-18
See also:
http://www.sqlite.org/lang_select.html

Member Function Documentation

- (void) column: (id)  column
Signature:
column:
Discussion:
This method will add a column to the SQL statement.
Parameters:
columnThe column to be selected.
Updated:
2012-03-24
- (void) column: (id)  column
alias: (NSString *)  alias 
Signature:
column:alias:
Discussion:
This method will add a column to the SQL statement.
Parameters:
columnThe column to be selected.
aliasThe alias to be used.
Updated:
2012-03-24
- (void) combine: (NSString *)  statement
operator: (NSString *)  operator 
Signature:
combine:operator:
Discussion:
This method will combine a select statement using the specified operator.
Parameters:
statementThe select statement that will be appended.
operatorThe operator to be used. Must use UNION, UNION ALL, INTERSECT, or EXCEPT.
Updated:
2012-03-18
- (void) distinct: (BOOL)  distinct
Signature:
distinct:
Discussion:
This method will add the "DISTINCT" keyword to the SQL statement.
Parameters:
distinctThis will determine whether the "DISTINCT" keyword should added.
Updated:
2011-03-17
- (void) from: (id)  table
Signature:
from:
Discussion:
This method will add a from clause to the SQL statement.
Parameters:
tableThe table to used in the clause.
Updated:
2012-03-24
- (void) from: (id)  table
alias: (NSString *)  alias 
Signature:
from:alias:
Discussion:
This method will add a from clause to the SQL statement.
Parameters:
tableThe table to used in the clause.
aliasThe alias to be used.
Updated:
2012-03-24
- (void) groupBy: (NSString *)  column
Signature:
groupBy:
Discussion:
This method will add a group by clause to the SQL statement.
Parameters:
columnThe column to be grouped.
Updated:
2011-04-01
- (void) groupByHaving: (id)  column1
operator: (NSString *)  operator
column: (id)  column2 
Signature:
groupByHaving:operator:column:
Discussion:
This method will add a having clause to the SQL statement.
Parameters:
column1The column to be tested.
operatorThe operator to be used.
column2The column to be compared.
Updated:
2012-03-24
- (void) groupByHaving: (id)  column1
operator: (NSString *)  operator
column: (id)  column2
connector: (NSString *)  connector 
Signature:
groupByHaving:operator:column:connector:
Discussion:
This method will add a having clause to the SQL statement.
Parameters:
column1The column to be tested.
operatorThe operator to be used.
column2The column to be compared.
connectorThe connector to be used.
Updated:
2012-03-24
- (void) groupByHaving: (id)  column
operator: (NSString *)  operator
value: (id)  value 
Signature:
groupByHaving:operator:value:
Discussion:
This method will add a having clause to the SQL statement.
Parameters:
columnThe column to be tested.
operatorThe operator to be used.
valueThe value to be compared.
Updated:
2012-03-24
- (void) groupByHaving: (id)  column
operator: (NSString *)  operator
value: (id)  value
connector: (NSString *)  connector 
Signature:
groupByHaving:operator:value:connector:
Discussion:
This method will add a having clause to the SQL statement.
Parameters:
columnThe column to be tested.
operatorThe operator to be used.
valueThe value to be compared.
connectorThe connector to be used.
Updated:
2012-03-24
- (void) groupByHavingBlock: (NSString *)  brace
Signature:
groupByHavingBlock:
Discussion:
This method will start or end a block.
Parameters:
braceThe brace to be used; it is either an opening or closing brace.
Updated:
2011-03-18
- (void) groupByHavingBlock: (NSString *)  brace
connector: (NSString *)  connector 
Signature:
groupByHavingBlock:connector:
Discussion:
This method will start or end a block.
Parameters:
braceThe brace to be used; it is either an opening or closing brace.
connectorThe connector to be used.
Updated:
2011-03-18
- (instancetype) init [implementation]
- (void) join: (id)  table
Signature:
join:
Discussion:
This method will add a join clause to the SQL statement.
Parameters:
tableThe table to used in the clause.
Updated:
2012-03-24
- (void) join: (id)  table
alias: (NSString *)  alias 
Signature:
join:alias:
Discussion:
This method will add a join clause to the SQL statement.
Parameters:
tableThe table to used in the clause.
aliasThe alias to be used.
Updated:
2012-03-24
- (void) join: (id)  table
alias: (NSString *)  alias
type: (NSString *)  type 
Signature:
join:alias:type:
Discussion:
This method will add a join clause to the SQL statement.
Parameters:
tableThe table to used in the clause.
aliasThe alias to be used.
typeThe type of join clause.
Updated:
2012-03-24
- (void) join: (id)  table
type: (NSString *)  type 
Signature:
join:type:
Discussion:
This method will add a join clause to the SQL statement.
Parameters:
tableThe table to used in the clause.
typeThe type of join clause.
Updated:
2012-03-24
- (void) joinOn: (id)  column1
operator: (NSString *)  operator
column: (id)  column2 
Signature:
joinOn:operator:column:
Discussion:
This method will add a join condition to the last defined join clause.
Parameters:
column1The column to be tested.
operatorThe operator to be used.
column2The column to be tested on.
Updated:
2012-03-24
- (void) joinOn: (id)  column1
operator: (NSString *)  operator
column: (id)  column2
connector: (NSString *)  connector 
Signature:
joinOn:operator:column:connector:
Discussion:
This method will add a join condition to the last defined join clause.
Parameters:
column1The column to be tested.
operatorThe operator to be used.
column2The column to be tested on.
connectorThe connector to be used.
Updated:
2012-03-24
- (void) joinOn: (id)  column
operator: (NSString *)  operator
value: (id)  value 
Signature:
joinOn:operator:value:
Discussion:
This method will add a join condition to the last defined join clause.
Parameters:
columnThe column to be tested.
operatorThe operator to be used.
valueThe value to be compared.
Updated:
2012-03-24
- (void) joinOn: (id)  column
operator: (NSString *)  operator
value: (id)  value
connector: (NSString *)  connector 
Signature:
joinOn:operator:value:connector:
Discussion:
This method will add a join condition to the last defined join clause.
Parameters:
columnThe column to be tested.
operatorThe operator to be used.
valueThe value to be compared.
connectorThe connector to be used.
Updated:
2012-03-24
- (void) joinUsing: (NSString *)  column
Signature:
joinUsing:
Discussion:
This method will add a join condition to the last defined join clause.
Parameters:
columnThe column to be tested.
Updated:
2011-07-15
- (void) limit: (NSUInteger)  limit
Signature:
limit:
Discussion:
This method will add a limit clause to the SQL statement.
Parameters:
limitThe number of records to be returned.
Updated:
2012-03-18
- (void) limit: (NSUInteger)  limit
offset: (NSUInteger)  offset 
Signature:
limit:offset:
Discussion:
This method will add a limit clause and an offset clause to the SQL statement.
Parameters:
limitThe number of records to be returned.
offsetThe starting point to start evaluating.
Updated:
2012-03-18
- (void) offset: (NSUInteger)  offset
Signature:
offset:
Discussion:
This method will add an offset clause to the SQL statement.
Parameters:
offsetThe starting point to start evaluating.
Updated:
2012-03-18
- (void) orderBy: (NSString *)  column
Signature:
orderBy:
Discussion:
This method will add an order by clause to the SQL statement.
Parameters:
columnThe column to be ordered.
Updated:
2012-03-19
- (void) orderBy: (NSString *)  column
descending: (BOOL)  descending 
Signature:
orderBy:descending:
Discussion:
This method will add an order by clause to the SQL statement.
Parameters:
columnThe column to be ordered.
descendingThis will determine whether the column should be ordered in descending order.
Updated:
2012-03-19
- (void) orderBy: (NSString *)  column
descending: (BOOL)  descending
nulls: (NSString *)  weight 
Signature:
orderBy:descending:nulls:
Discussion:
This method will add an order by clause to the SQL statement.
Parameters:
columnThe column to be ordered.
descendingThis will determine whether the column should be ordered in descending order.
weightThis indicates how nulls are to be weighed when comparing with non-nulls.
Updated:
2012-03-19
See also:
http://sqlite.org/cvstrac/wiki?p=UnsupportedSql
https://hibernate.onjira.com/browse/HHH-465
http://sqlblog.com/blogs/denis_gobo/archive/2007/10/19/3048.aspx
- (void) orderBy: (NSString *)  column
nulls: (NSString *)  weight 
Signature:
orderBy:nulls:
Discussion:
This method will add an order by clause to the SQL statement.
Parameters:
columnThe column to be ordered.
weightThis indicates how nulls are to be weighed when comparing with non-nulls.
Updated:
2012-03-19
See also:
http://sqlite.org/cvstrac/wiki?p=UnsupportedSql
https://hibernate.onjira.com/browse/HHH-465
http://sqlblog.com/blogs/denis_gobo/archive/2007/10/19/3048.aspx
- (NSString *) statement
Signature:
statement
Discussion:
This method will return the SQL statement.
Returns:
The SQL statement that was constructed.
Updated:
2012-03-18

Reimplemented from <ZIMSqlStatement>.

- (void) where: (id)  column1
operator: (NSString *)  operator
column: (id)  column2 
Signature:
where:operator:column:
Discussion:
This method will add a where clause to the SQL statement.
Parameters:
column1The column to be tested.
operatorThe operator to be used.
column2The column to be compared.
Updated:
2012-03-24
- (void) where: (id)  column1
operator: (NSString *)  operator
column: (id)  column2
connector: (NSString *)  connector 
Signature:
where:operator:column:connector:
Discussion:
This method will add a where clause to the SQL statement.
Parameters:
column1The column to be tested.
operatorThe operator to be used.
column2The column to be compared.
connectorThe connector to be used.
Updated:
2012-03-24
- (void) where: (id)  column
operator: (NSString *)  operator
value: (id)  value 
Signature:
where:operator:value:
Discussion:
This method will add a where clause to the SQL statement.
Parameters:
columnThe column to be tested.
operatorThe operator to be used.
valueThe value to be compared.
Updated:
2012-03-24
- (void) where: (id)  column
operator: (NSString *)  operator
value: (id)  value
connector: (NSString *)  connector 
Signature:
where:operator:value:connector:
Discussion:
This method will add a where clause to the SQL statement.
Parameters:
columnThe column to be tested.
operatorThe operator to be used.
valueThe value to be compared.
connectorThe connector to be used.
Updated:
2012-03-24
- (void) whereBlock: (NSString *)  brace
Signature:
whereBlock:
Discussion:
This method will start or end a block.
Parameters:
braceThe brace to be used; it is either an opening or closing brace.
Updated:
2011-03-13
- (void) whereBlock: (NSString *)  brace
connector: (NSString *)  connector 
Signature:
whereBlock:connector:
Discussion:
This method will start or end a block.
Parameters:
braceThe brace to be used; it is either an opening or closing brace.
connectorThe connector to be used.
Updated:
2011-04-01

Member Data Documentation

- (NSMutableArray*) _column [protected]
- (NSMutableArray*) _combine [protected]
- (BOOL) _distinct [protected]
- (NSMutableArray*) _groupBy [protected]
- (NSMutableArray*) _having [protected]
- (NSMutableArray*) _join [protected]
- (NSUInteger) _limit [protected]
- (NSUInteger) _offset [protected]
- (NSMutableArray*) _orderBy [protected]
- (NSMutableArray*) _table [protected]
- (NSMutableArray*) _where [protected]

The documentation for this class was generated from the following files:
 All Classes Files Functions Variables Properties Defines