Compoze Software, Inc.

com.compoze.exchange.webdav.sql
Class SelectStatement


java.lang.Object

  |

  +--com.compoze.exchange.webdav.sql.AbstractSqlFragment

        |

        +--com.compoze.exchange.webdav.sql.SelectStatement

All Implemented Interfaces:
ISqlFragment, java.io.Serializable

public class SelectStatement
extends AbstractSqlFragment
implements ISqlFragment, java.io.Serializable

This class represents the Structured Query Language (SQL) "SELECT" statement. The "SELECT" statement is used to select items from a data store.

The following example illustrates the use of SelectStatement:

  SelectStatement stmt = new SelectStatement(
      new String[]
	    {
	    "\"DAV:href\"",
	    "\"DAV:displayname\"",
	    "\"DAV:contentclass\"",
	    "\"urn:schemas:httpmail:subject\""
	    },
	new FromClause(new String[]
	    {
	    "/exchange/skip.ogrudnick/Inbox/",
	    "/exchange/skip.ogrudnick/Inbox/sub1/",
	    "/exchange/skip.ogrudnick/Inbox/sub2/"
	    }, IScope.SHALLOW_TRAVERSAL),
	new WhereClause(Condition.create(new GreaterThanOperator("urn:schemas:contacts:givenName", "Skip"), true)),
	new GroupByClause(new String[] 
	    {
	    "DAV:href",
	    "DAV:contentclass"
 	    }),
      OrderByClause.create("uurn:schemas:httpmail:datereceived", OrderByClause.DESCENDING));

  System.out.println(stmt);
 

See Also:
Serialized Form

Constructor Summary
SelectStatement(java.lang.String[] properties, FromClause from, WhereClause where, GroupByClause groupBy, OrderByClause orderBy)
          Constructor.
SelectStatement(java.lang.String[] properties, java.lang.String[] sources, int iScope)
          Constructor.
 
Method Summary
static void main(java.lang.String[] args)
          Main.
 java.lang.String toSQL()
          Returns a string representation of the object.
 
Methods inherited from class com.compoze.exchange.webdav.sql.AbstractSqlFragment
escape, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SelectStatement


public SelectStatement(java.lang.String[] properties,
                       java.lang.String[] sources,
                       int iScope)
Constructor.
Parameters:
properties - an array of properties
sources - an array of URLs of source collections
iScope - the scope of the search

SelectStatement


public SelectStatement(java.lang.String[] properties,
                       FromClause from,
                       WhereClause where,
                       GroupByClause groupBy,
                       OrderByClause orderBy)
Constructor.
Parameters:
properties - an array of properties
from - the "FROM" clause
where - the "WHERE" clause
groupBy - the "GROUP BY" clause
orderBy - the "ORDER BY" clause
Method Detail

toSQL


public java.lang.String toSQL()
Returns a string representation of the object.
Specified by:
toSQL in interface ISqlFragment
Overrides:
toSQL in class AbstractSqlFragment
Returns:
the string representation of the object

main


public static void main(java.lang.String[] args)
Main.
This is the exerciser.
Parameters:
args - array of arguments

Compoze Software, Inc.

Copyright ©1999-2003 Compoze Software, Inc. All rights reserved.