SolarMetric Kodo JDO 2.5.8 generated on January 11 2004

com.solarmetric.kodo.impl.jdbc.query
Class QuerySelect

java.lang.Object
  |
  +--com.solarmetric.kodo.impl.jdbc.query.QuerySelect

public class QuerySelect
extends Object

Abstraction of a SQL SELECT statement.


Constructor Summary
(package private) QuerySelect(DBDictionary dict, int syntax)
          Protected constructor.
 
Method Summary
 void addJoins(QuerySQLBuffer buf, Joins joins)
          Add SQL for the given joins to the given buffer.
 Joins and(Joins joins1, Joins joins2)
          AND the given joins together.
 DBDictionary getDictionary()
          Return the dictionary being used by this select.
 boolean isUpdate()
          Return true if this is a SELECT FOR UPDATE.
 QuerySelect joinsClone()
          Return a SELECT with the same aliases and joins as this one.
 Joins newJoins()
          Return a new instance to use for joining.
 Joins or(Joins joins1, Joins joins2)
          OR the given joins together.
 void orderBy(Column col, boolean ascending)
          Add an ORDER BY clause.
 void orderBy(Column col, boolean ascending, Joins joins)
          Add an ORDER BY clause.
 Joins orderBy(Joins joins1, Joins joins2)
          Combine the given joins.
 void orderBy(QuerySQLBuffer sql, boolean ascending)
          Add an ORDER BY clause.
 void orderBy(QuerySQLBuffer sql, boolean ascending, Joins joins)
          Add an ORDER BY clause.
 void select(Column col)
          Select the given column.
 void select(Column[] cols)
          Select the given columns.
 void select(Column[] cols, Joins joins)
          Select the given columns after making the given joins.
 void select(Column col, Joins joins)
          Select the given column after making the given joins.
 void setUpdate(boolean update)
          Set whether this is a SELECT FOR UPDATE.
 SQLBuffer toSelect()
          Return this select as a SQL statement formatted for the given dictionary.
 void where(Joins joins)
          Add the given where conditions.
 void where(QuerySQLBuffer sql)
          Add the given where conditions.
 void where(QuerySQLBuffer sql, Joins joins)
          Add the given where conditions.
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

QuerySelect

QuerySelect(DBDictionary dict,
            int syntax)
Protected constructor.
Parameters:
dict - the database dictionary in use
syntax - the JDBCQuery constant for the SQL syntax to use
Method Detail

getDictionary

public DBDictionary getDictionary()
Return the dictionary being used by this select.

toSelect

public SQLBuffer toSelect()
Return this select as a SQL statement formatted for the given dictionary.

isUpdate

public boolean isUpdate()
Return true if this is a SELECT FOR UPDATE.

setUpdate

public void setUpdate(boolean update)
Set whether this is a SELECT FOR UPDATE.

select

public void select(Column col)
Select the given column.

select

public void select(Column col,
                   Joins joins)
Select the given column after making the given joins.

select

public void select(Column[] cols)
Select the given columns.

select

public void select(Column[] cols,
                   Joins joins)
Select the given columns after making the given joins.

where

public void where(Joins joins)
Add the given where conditions.

where

public void where(QuerySQLBuffer sql)
Add the given where conditions.

where

public void where(QuerySQLBuffer sql,
                  Joins joins)
Add the given where conditions.

orderBy

public void orderBy(QuerySQLBuffer sql,
                    boolean ascending)
Add an ORDER BY clause.

orderBy

public void orderBy(QuerySQLBuffer sql,
                    boolean ascending,
                    Joins joins)
Add an ORDER BY clause.

orderBy

public void orderBy(Column col,
                    boolean ascending)
Add an ORDER BY clause.

orderBy

public void orderBy(Column col,
                    boolean ascending,
                    Joins joins)
Add an ORDER BY clause.

joinsClone

public QuerySelect joinsClone()
Return a SELECT with the same aliases and joins as this one.

newJoins

public Joins newJoins()
Return a new instance to use for joining.

addJoins

public void addJoins(QuerySQLBuffer buf,
                     Joins joins)
Add SQL for the given joins to the given buffer.

and

public Joins and(Joins joins1,
                 Joins joins2)
AND the given joins together. The given joins will be hollowed in the process.

or

public Joins or(Joins joins1,
                Joins joins2)
OR the given joins together. The common joins will be removed in the process.

orderBy

public Joins orderBy(Joins joins1,
                     Joins joins2)
Combine the given joins.
Parameters:
joins1 - joins from the main expression
joins2 - joins from the ordering value

SolarMetric Kodo JDO 2.5.8 generated on January 11 2004

Copyright 2001,2002,2003 SolarMetric, Inc. All Rights Reserved.