org.gibello.zql
Class ZQuery

java.lang.Object
  extended by org.gibello.zql.ZQuery
All Implemented Interfaces:
java.io.Serializable, ZExp, ZStatement

public class ZQuery
extends java.lang.Object
implements ZStatement, ZExp

ZQuery: an SQL SELECT statement

See Also:
Serialized Form

Constructor Summary
ZQuery()
          Create a new SELECT statement
 
Method Summary
 void addFrom(java.util.Vector f)
          Insert the FROM part of the statement
 void addGroupBy(ZGroupBy g)
          Insert a GROUP BY...HAVING clause
 void addOrderBy(java.util.Vector v)
          Insert an ORDER BY clause
 void addSelect(java.util.Vector s)
          Insert the SELECT part of the statement
 void addSet(ZExpression s)
          Insert a SET clause (generally UNION, INTERSECT or MINUS)
 void addWhere(ZExp w)
          Insert a WHERE clause
 java.util.Vector getFrom()
          Get the FROM part of the statement
 ZGroupBy getGroupBy()
          Get the GROUP BY...HAVING part of the statement
 java.util.Vector getOrderBy()
          Get the ORDER BY clause
 java.util.Vector getSelect()
          Get the SELECT part of the statement
 ZExpression getSet()
          Get the SET clause (generally UNION, INTERSECT or MINUS)
 ZExp getWhere()
          Get the WHERE part of the statement
 boolean isDistinct()
           
 boolean isForUpdate()
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ZQuery

public ZQuery()
Create a new SELECT statement

Method Detail

addSelect

public void addSelect(java.util.Vector s)
Insert the SELECT part of the statement

Parameters:
s - A vector of ZSelectItem objects

addFrom

public void addFrom(java.util.Vector f)
Insert the FROM part of the statement

Parameters:
f - a Vector of ZFromItem objects

addWhere

public void addWhere(ZExp w)
Insert a WHERE clause

Parameters:
w - An SQL Expression

addGroupBy

public void addGroupBy(ZGroupBy g)
Insert a GROUP BY...HAVING clause

Parameters:
g - A GROUP BY...HAVING clause

addSet

public void addSet(ZExpression s)
Insert a SET clause (generally UNION, INTERSECT or MINUS)

Parameters:
s - An SQL Expression (generally UNION, INTERSECT or MINUS)

addOrderBy

public void addOrderBy(java.util.Vector v)
Insert an ORDER BY clause

Parameters:
v - A vector of ZOrderBy objects

getSelect

public java.util.Vector getSelect()
Get the SELECT part of the statement

Returns:
A vector of ZSelectItem objects

getFrom

public java.util.Vector getFrom()
Get the FROM part of the statement

Returns:
A vector of ZFromItem objects

getWhere

public ZExp getWhere()
Get the WHERE part of the statement

Returns:
An SQL Expression or sub-query (ZExpression or ZQuery object)

getGroupBy

public ZGroupBy getGroupBy()
Get the GROUP BY...HAVING part of the statement

Returns:
A GROUP BY...HAVING clause

getSet

public ZExpression getSet()
Get the SET clause (generally UNION, INTERSECT or MINUS)

Returns:
An SQL Expression (generally UNION, INTERSECT or MINUS)

getOrderBy

public java.util.Vector getOrderBy()
Get the ORDER BY clause

Parameters:
v - A vector of ZOrderBy objects

isDistinct

public boolean isDistinct()
Returns:
true if it is a SELECT DISTINCT query, false otherwise.

isForUpdate

public boolean isForUpdate()
Returns:
true if it is a FOR UPDATE query, false otherwise.

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object