org.sqlorm.querybuilder
Class SurogateAndOrListSelectBuilder

java.lang.Object
  extended by org.sqlorm.querybuilder.SurogateAndOrListSelectBuilder
All Implemented Interfaces:
ItfAndOrList, ItfSelectBuilder

public class SurogateAndOrListSelectBuilder
extends Object
implements ItfAndOrList, ItfSelectBuilder

Represents at the same time an AndOrList and a SelectBuilder

Since:
1.0.02
Author:
Kasper B. Graversen, (c) 2007-2008

Constructor Summary
SurogateAndOrListSelectBuilder(ItfSelectBuilder builder, AndOrList list)
          One of the two must be set.
 
Method Summary
 ItfAndOrList and(org.sqlorm.querybuilder.IPositionAndOr andOr)
           
 SurogateAndOrListSelectBuilder and(String sqlString)
           
 SurogateAndOrListSelectBuilder and(String fmtString, Object... args)
           
 MultiJoinOnExpr crossJoin(ITableName table)
           
 MultiJoinOnExpr crossJoin(ITableName table, String alias)
           
 MultiJoinOnExpr crossJoin(String table)
           
 MultiJoinOnExpr crossJoin(String table, String alias)
           
 ItfSelectBuilder distinct()
           
 ItfSelectBuilder from(ITableName from)
           
 ItfSelectBuilder from(ITableName from, String alias)
           
 ItfSelectBuilder from(ItfSelectBuilder subSelect, String alias)
           
 ItfSelectBuilder from(String from)
           
 ItfSelectBuilder from(String from, String alias)
           
 ItfSelectBuilder groupBy(ITableName table)
           
 ItfSelectBuilder groupBy(String... tableNames)
           
 SurogateAndOrListSelectBuilder having()
           
 MultiJoinOnExpr innerJoin(ITableName table)
           
 MultiJoinOnExpr innerJoin(ITableName table, String alias)
           
 MultiJoinOnExpr innerJoin(String table)
           
 MultiJoinOnExpr innerJoin(String table, String alias)
           
 ItfSelectBuilder internal_setAlias(String alias)
           
 ItfSelectBuilder internal_setIsNestedSelect()
           
 void internal_setIsOutermostList()
          internal method!
 int internal_size()
          internal method!
 MultiJoinOnExpr leftJoin(ITableName table)
           
 MultiJoinOnExpr leftJoin(ITableName table, String alias)
           
 MultiJoinOnExpr leftJoin(String table)
           
 MultiJoinOnExpr leftJoin(String table, String alias)
           
 SurogateAndOrListSelectBuilder or(org.sqlorm.querybuilder.IPositionAndOr andOr)
           
 SurogateAndOrListSelectBuilder or(String sqlString)
           
 SurogateAndOrListSelectBuilder or(String fmtString, Object... args)
           
 ItfSelectBuilder orderBy(ITableName table)
           
 ItfSelectBuilder orderBy(String tableName)
           
 ItfSelectBuilder orderByAsc(ITableName table)
           
 ItfSelectBuilder orderByAsc(String tableName)
           
 ItfSelectBuilder orderByDesc(ITableName table)
           
 ItfSelectBuilder orderByDesc(String tableName)
           
 MultiJoinOnExpr outerJoin(ITableName table)
           
 MultiJoinOnExpr outerJoin(ITableName table, String alias)
           
 MultiJoinOnExpr outerJoin(String table)
           
 MultiJoinOnExpr outerJoin(String table, String alias)
           
 MultiJoinOnExpr rightJoin(ITableName table)
           
 MultiJoinOnExpr rightJoin(ITableName table, String alias)
           
 MultiJoinOnExpr rightJoin(String table)
           
 MultiJoinOnExpr rightJoin(String table, String alias)
           
 ItfSelectBuilder select(IColumnName column)
           
 ItfSelectBuilder select(IColumnName column, String alias)
           
 ItfSelectBuilder select(String column)
          Select a column
 ItfSelectBuilder select(String column, String alias)
          Select a column
 String toSql()
          Call this method for generating an SQL expression from your object.
 void toSql(StringBuilder sb, String indent)
           
 SurogateAndOrListSelectBuilder where()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SurogateAndOrListSelectBuilder

public SurogateAndOrListSelectBuilder(ItfSelectBuilder builder,
                                      AndOrList list)
One of the two must be set. Denote what the sourogate is a sourogate for.

Parameters:
builder - non-null if surogate for a selectBuilder
list - non-null if surogate for an AndOrList
Method Detail

and

public ItfAndOrList and(org.sqlorm.querybuilder.IPositionAndOr andOr)
Specified by:
and in interface ItfAndOrList
Parameters:
andOr -
Returns:
See Also:
org.sqlorm.querybuilder.IAndOrList#and(org.sqlorm.querybuilder.IPositionAndOr)

and

public SurogateAndOrListSelectBuilder and(String sqlString)
Specified by:
and in interface ItfAndOrList
Parameters:
sqlString -
Returns:
See Also:
org.sqlorm.querybuilder.IAndOrList#and(java.lang.String)

and

public SurogateAndOrListSelectBuilder and(String fmtString,
                                          Object... args)
Specified by:
and in interface ItfAndOrList
Parameters:
fmtString -
args -
Returns:
See Also:
org.sqlorm.querybuilder.IAndOrList#and(java.lang.String, java.lang.Object[])

crossJoin

public MultiJoinOnExpr crossJoin(ITableName table)
Specified by:
crossJoin in interface ItfSelectBuilder

crossJoin

public MultiJoinOnExpr crossJoin(ITableName table,
                                 String alias)
Specified by:
crossJoin in interface ItfSelectBuilder

crossJoin

public MultiJoinOnExpr crossJoin(String table)
Specified by:
crossJoin in interface ItfSelectBuilder
Parameters:
table -
Returns:
See Also:
SelectBuilder.crossJoin(java.lang.String)

crossJoin

public MultiJoinOnExpr crossJoin(String table,
                                 String alias)
Specified by:
crossJoin in interface ItfSelectBuilder
Parameters:
table -
alias -
Returns:
See Also:
SelectBuilder.crossJoin(java.lang.String, java.lang.String)

distinct

public ItfSelectBuilder distinct()
Specified by:
distinct in interface ItfSelectBuilder
Returns:
See Also:
SelectBuilder.distinct()

from

public ItfSelectBuilder from(ITableName from)
Specified by:
from in interface ItfSelectBuilder

from

public ItfSelectBuilder from(ITableName from,
                             String alias)
Specified by:
from in interface ItfSelectBuilder

from

public ItfSelectBuilder from(ItfSelectBuilder subSelect,
                             String alias)
Specified by:
from in interface ItfSelectBuilder
Parameters:
subSelect -
alias -
Returns:
See Also:
org.sqlorm.querybuilder.SelectBuilder#from(org.sqlorm.querybuilder.SelectBuilder, java.lang.String)

from

public ItfSelectBuilder from(String from)
Specified by:
from in interface ItfSelectBuilder
Parameters:
from -
Returns:
See Also:
SelectBuilder.from(java.lang.String)

from

public ItfSelectBuilder from(String from,
                             String alias)
Specified by:
from in interface ItfSelectBuilder
Parameters:
from -
alias -
Returns:
See Also:
SelectBuilder.from(java.lang.String, java.lang.String)

groupBy

public ItfSelectBuilder groupBy(ITableName table)
Specified by:
groupBy in interface ItfSelectBuilder

groupBy

public ItfSelectBuilder groupBy(String... tableNames)
Specified by:
groupBy in interface ItfSelectBuilder
Parameters:
tableNames -
Returns:
See Also:
SelectBuilder.groupBy(java.lang.String[])

having

public SurogateAndOrListSelectBuilder having()
Specified by:
having in interface ItfSelectBuilder
Returns:
See Also:
SelectBuilder.having()

innerJoin

public MultiJoinOnExpr innerJoin(ITableName table)
Specified by:
innerJoin in interface ItfSelectBuilder

innerJoin

public MultiJoinOnExpr innerJoin(ITableName table,
                                 String alias)
Specified by:
innerJoin in interface ItfSelectBuilder

innerJoin

public MultiJoinOnExpr innerJoin(String table)
Specified by:
innerJoin in interface ItfSelectBuilder
Parameters:
table -
Returns:
See Also:
SelectBuilder.innerJoin(java.lang.String)

innerJoin

public MultiJoinOnExpr innerJoin(String table,
                                 String alias)
Specified by:
innerJoin in interface ItfSelectBuilder
Parameters:
table -
alias -
Returns:
See Also:
SelectBuilder.innerJoin(java.lang.String, java.lang.String)

internal_setAlias

public ItfSelectBuilder internal_setAlias(String alias)
Specified by:
internal_setAlias in interface ItfSelectBuilder
Parameters:
alias -
Returns:
See Also:
SelectBuilder.internal_setAlias(java.lang.String)

internal_setIsNestedSelect

public ItfSelectBuilder internal_setIsNestedSelect()
Specified by:
internal_setIsNestedSelect in interface ItfSelectBuilder
Returns:
See Also:
SelectBuilder.internal_setIsNestedSelect()

internal_setIsOutermostList

public void internal_setIsOutermostList()
Description copied from interface: ItfAndOrList
internal method! Use this method when creating InnerJoin expressions or other elements that contains lists, where that list may be nested in other lists. But where the outermost list must be formatted differently than the nested lists.

Specified by:
internal_setIsOutermostList in interface ItfAndOrList
See Also:
org.sqlorm.querybuilder.IAndOrList#internal_setIsOutermostList()

internal_size

public int internal_size()
internal method! don't use it.

Specified by:
internal_size in interface ItfAndOrList
Returns:
See Also:
org.sqlorm.querybuilder.IAndOrList#internal_size()

leftJoin

public MultiJoinOnExpr leftJoin(ITableName table)
Specified by:
leftJoin in interface ItfSelectBuilder

leftJoin

public MultiJoinOnExpr leftJoin(ITableName table,
                                String alias)
Specified by:
leftJoin in interface ItfSelectBuilder

leftJoin

public MultiJoinOnExpr leftJoin(String table)
Specified by:
leftJoin in interface ItfSelectBuilder
Parameters:
table -
Returns:
See Also:
SelectBuilder.leftJoin(java.lang.String)

leftJoin

public MultiJoinOnExpr leftJoin(String table,
                                String alias)
Specified by:
leftJoin in interface ItfSelectBuilder
Parameters:
table -
alias -
Returns:
See Also:
SelectBuilder.leftJoin(java.lang.String, java.lang.String)

or

public SurogateAndOrListSelectBuilder or(org.sqlorm.querybuilder.IPositionAndOr andOr)
Specified by:
or in interface ItfAndOrList
Parameters:
andOr -
Returns:
See Also:
org.sqlorm.querybuilder.IAndOrList#or(org.sqlorm.querybuilder.IPositionAndOr)

or

public SurogateAndOrListSelectBuilder or(String sqlString)
Specified by:
or in interface ItfAndOrList
Parameters:
sqlString -
Returns:
See Also:
org.sqlorm.querybuilder.IAndOrList#or(java.lang.String)

or

public SurogateAndOrListSelectBuilder or(String fmtString,
                                         Object... args)
Specified by:
or in interface ItfAndOrList
Parameters:
fmtString -
args -
Returns:
See Also:
org.sqlorm.querybuilder.IAndOrList#or(java.lang.String, java.lang.Object[])

orderBy

public ItfSelectBuilder orderBy(ITableName table)
Specified by:
orderBy in interface ItfSelectBuilder

orderBy

public ItfSelectBuilder orderBy(String tableName)
Specified by:
orderBy in interface ItfSelectBuilder
Parameters:
tableName -
Returns:
See Also:
SelectBuilder.orderBy(java.lang.String)

orderByAsc

public ItfSelectBuilder orderByAsc(ITableName table)
Specified by:
orderByAsc in interface ItfSelectBuilder

orderByAsc

public ItfSelectBuilder orderByAsc(String tableName)
Specified by:
orderByAsc in interface ItfSelectBuilder
Parameters:
tableName -
Returns:
See Also:
SelectBuilder.orderByAsc(java.lang.String)

orderByDesc

public ItfSelectBuilder orderByDesc(ITableName table)
Specified by:
orderByDesc in interface ItfSelectBuilder

orderByDesc

public ItfSelectBuilder orderByDesc(String tableName)
Specified by:
orderByDesc in interface ItfSelectBuilder
Parameters:
tableName -
Returns:
See Also:
SelectBuilder.orderByDesc(java.lang.String)

outerJoin

public MultiJoinOnExpr outerJoin(ITableName table)
Specified by:
outerJoin in interface ItfSelectBuilder

outerJoin

public MultiJoinOnExpr outerJoin(ITableName table,
                                 String alias)
Specified by:
outerJoin in interface ItfSelectBuilder

outerJoin

public MultiJoinOnExpr outerJoin(String table)
Specified by:
outerJoin in interface ItfSelectBuilder
Parameters:
table -
Returns:
See Also:
SelectBuilder.outerJoin(java.lang.String)

outerJoin

public MultiJoinOnExpr outerJoin(String table,
                                 String alias)
Specified by:
outerJoin in interface ItfSelectBuilder
Parameters:
table -
alias -
Returns:
See Also:
SelectBuilder.outerJoin(java.lang.String, java.lang.String)

rightJoin

public MultiJoinOnExpr rightJoin(ITableName table)
Specified by:
rightJoin in interface ItfSelectBuilder

rightJoin

public MultiJoinOnExpr rightJoin(ITableName table,
                                 String alias)
Specified by:
rightJoin in interface ItfSelectBuilder

rightJoin

public MultiJoinOnExpr rightJoin(String table)
Specified by:
rightJoin in interface ItfSelectBuilder
Parameters:
table -
Returns:
See Also:
SelectBuilder.rightJoin(java.lang.String)

rightJoin

public MultiJoinOnExpr rightJoin(String table,
                                 String alias)
Specified by:
rightJoin in interface ItfSelectBuilder
Parameters:
table -
alias -
Returns:
See Also:
SelectBuilder.rightJoin(java.lang.String, java.lang.String)

select

public ItfSelectBuilder select(IColumnName column)
Specified by:
select in interface ItfSelectBuilder

select

public ItfSelectBuilder select(IColumnName column,
                               String alias)
Specified by:
select in interface ItfSelectBuilder

select

public ItfSelectBuilder select(String column)
Description copied from interface: ItfSelectBuilder
Select a column

Specified by:
select in interface ItfSelectBuilder
Parameters:
column -
Returns:
See Also:
SelectBuilder.select(java.lang.String)

select

public ItfSelectBuilder select(String column,
                               String alias)
Description copied from interface: ItfSelectBuilder
Select a column

Specified by:
select in interface ItfSelectBuilder
Parameters:
column -
alias -
Returns:
See Also:
SelectBuilder.select(java.lang.String, java.lang.String)

toSql

public String toSql()
Description copied from interface: ItfSelectBuilder
Call this method for generating an SQL expression from your object.

Specified by:
toSql in interface ItfSelectBuilder
Returns:
See Also:
SelectBuilder.toSql()

toSql

public void toSql(StringBuilder sb,
                  String indent)
Parameters:
sb -
indent -
See Also:
IExpr.toSql(java.lang.StringBuilder, java.lang.String)

where

public SurogateAndOrListSelectBuilder where()
Specified by:
where in interface ItfSelectBuilder
Returns:
See Also:
SelectBuilder.where()