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 java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
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).
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
)
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
Copyright ©1999-2003 Compoze Software, Inc. All rights reserved.