org.eobjects.metamodel.query
Class OrderByItem

java.lang.Object
  extended by org.eobjects.metamodel.util.BaseObject
      extended by org.eobjects.metamodel.query.OrderByItem
All Implemented Interfaces:
Serializable, Cloneable, QueryItem

public class OrderByItem
extends BaseObject
implements QueryItem, Cloneable

Represents an ORDER BY item. An OrderByItem sorts the resulting DataSet according to a SelectItem that may or may not be a part of the query already.

See Also:
OrderByClause, SelectItem, Serialized Form

Nested Class Summary
static class OrderByItem.Direction
           
 
Constructor Summary
OrderByItem(SelectItem selectItem)
          Creates an ascending OrderByItem
OrderByItem(SelectItem selectItem, boolean ascending)
          Deprecated. user OrderByItem(SelectItem, Direction) instead
OrderByItem(SelectItem selectItem, OrderByItem.Direction direction)
          Creates an OrderByItem
 
Method Summary
protected  OrderByItem clone()
           
protected  void decorateIdentity(List<Object> identifiers)
          Subclasses should implement this method and add all fields to the list that are to be included in equals(...) and hashCode() evaluation
 OrderByItem.Direction getDirection()
           
 Query getQuery()
           
 SelectItem getSelectItem()
           
 boolean isAscending()
           
 boolean isDescending()
           
 OrderByItem setDirection(OrderByItem.Direction direction)
           
 OrderByItem setQuery(Query query)
           
 String toSql()
           
 String toSql(boolean includeSchemaInColumnPaths)
           
 String toString()
           
 
Methods inherited from class org.eobjects.metamodel.util.BaseObject
classEquals, equals, hashCode
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

OrderByItem

public OrderByItem(SelectItem selectItem,
                   OrderByItem.Direction direction)
Creates an OrderByItem

Parameters:
selectItem - the select item to order
direction - the direction to order the select item

OrderByItem

@Deprecated
public OrderByItem(SelectItem selectItem,
                              boolean ascending)
Deprecated. user OrderByItem(SelectItem, Direction) instead

Creates an OrderByItem

Parameters:
selectItem -
ascending -

OrderByItem

public OrderByItem(SelectItem selectItem)
Creates an ascending OrderByItem

Parameters:
selectItem -
Method Detail

toSql

public String toSql(boolean includeSchemaInColumnPaths)
Specified by:
toSql in interface QueryItem

toSql

public String toSql()
Specified by:
toSql in interface QueryItem

isAscending

public boolean isAscending()

isDescending

public boolean isDescending()

getDirection

public OrderByItem.Direction getDirection()

setDirection

public OrderByItem setDirection(OrderByItem.Direction direction)

getSelectItem

public SelectItem getSelectItem()

getQuery

public Query getQuery()
Specified by:
getQuery in interface QueryItem

setQuery

public OrderByItem setQuery(Query query)
Specified by:
setQuery in interface QueryItem

clone

protected OrderByItem clone()
Overrides:
clone in class Object

decorateIdentity

protected void decorateIdentity(List<Object> identifiers)
Description copied from class: BaseObject
Subclasses should implement this method and add all fields to the list that are to be included in equals(...) and hashCode() evaluation

Specified by:
decorateIdentity in class BaseObject

toString

public String toString()
Specified by:
toString in interface QueryItem
Overrides:
toString in class BaseObject


Copyright © 2007-2013. All Rights Reserved.