Compoze Software, Inc.

com.compoze.exchange.webdav.sql
Class OrderByClause


java.lang.Object

  |

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

        |

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

All Implemented Interfaces:
ISqlFragment, java.io.Serializable
Direct Known Subclasses:
SortOrder

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

This class represents the Structured Query Language (SQL) "ORDER BY" clause. The "ORDER BY" clause sorts the results either ascending or descending order according to one or more properties.

The following example illustrates the use of OrderByClause:

  OrderByClause order = OrderByClause.create("DAV:href", DESCENDING);
  order.add("DAV:contentclass", DESCENDING);

  System.out.println(order);
 

See Also:
Serialized Form

Field Summary
static int ASCENDING
          This value represents an 'descending' sort order (A-Z, 0-9).
static int DESCENDING
          This value represents an 'descending' sort order (Z-A, 9-0).
 
Constructor Summary
protected OrderByClause()
          Constructor.
protected OrderByClause(java.lang.String sProperty, int iOrder)
          Constructor.
 
Method Summary
 void add(java.lang.String sProperty, int iOrder)
          Adds a property to sort by.
static OrderByClause create(java.lang.String sProperty, int iOrder)
          Creates a sort order with the specified property and sorting.
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
 

Field Detail

ASCENDING


public static final int ASCENDING
This value represents an 'descending' sort order (A-Z, 0-9).

DESCENDING


public static final int DESCENDING
This value represents an 'descending' sort order (Z-A, 9-0).
Constructor Detail

OrderByClause


protected OrderByClause()
Constructor.

OrderByClause


protected OrderByClause(java.lang.String sProperty,
                        int iOrder)
Constructor.
Parameters:
sProperty - the property to sort by (may not be null)
iOrder - the order to sort by (ASCENDING or DESCENDING)
Method Detail

create


public static OrderByClause create(java.lang.String sProperty,
                                   int iOrder)
Creates a sort order with the specified property and sorting.
Parameters:
sProperty - the property to sort by (may not be null)
iOrder - the order to sort by (ASCENDING or DESCENDING)

add


public void add(java.lang.String sProperty,
                int iOrder)
Adds a property to sort by.
Parameters:
property - the property to sort by (may not be null)
iOrder - the order to sort by (ASCENDING or DESCENDING)

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.