com.onewebsql.query
Class OrderByItem

java.lang.Object
  extended by com.onewebsql.query.OrderByItem
All Implemented Interfaces:
Expression

public class OrderByItem
extends Object
implements Expression

Represents an ORDER BY clause.


Field Summary
static String ASC
          Constant used to build a query.
static String DESC
          Constant used to build a query.
 
Fields inherited from interface com.onewebsql.query.Expression
COMMA, DOT, LB, QUESTION_MARK, RB, SPACE
 
Constructor Summary
OrderByItem(AExp expression, boolean ascending)
          Constructor.
 
Method Summary
 void build(StringBuilder sb, String schemaName, List<Value> objs, DBAdapter adapter)
          Builds the text of the query (or a part of it) represented by this object.
 boolean equals(Object obj)
           
 AExp getExpression()
          Returns the expression we are ordering by.
 int hashCode()
           
 boolean isAscending()
          Returns information whether the order is ascending.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ASC

public static final String ASC
Constant used to build a query.

See Also:
Constant Field Values

DESC

public static final String DESC
Constant used to build a query.

See Also:
Constant Field Values
Constructor Detail

OrderByItem

public OrderByItem(AExp expression,
                   boolean ascending)
Constructor.

Parameters:
expression - expression we are ordering by
ascending - whether the order is ascending
Method Detail

getExpression

public AExp getExpression()
Returns the expression we are ordering by.

Returns:
expression we are ordering by

isAscending

public boolean isAscending()
Returns information whether the order is ascending.

Returns:
true if the order is ascending, false if the order is descending

build

public void build(StringBuilder sb,
                  String schemaName,
                  List<Value> objs,
                  DBAdapter adapter)
Description copied from interface: Expression
Builds the text of the query (or a part of it) represented by this object.

Specified by:
build in interface Expression
Parameters:
sb - StringBuilder to build the query text
schemaName - name of the database schema used to build the query
objs - an accumulator list to which query parameters are appended
adapter - database adapter which builds builds query in a way specific to the database engine

hashCode

public int hashCode()
Overrides:
hashCode in class Object

equals

public boolean equals(Object obj)
Overrides:
equals in class Object


Copyright © 2011-2013 e-point SA. All Rights Reserved.