org.apache.empire.db.expr.order
Class DBOrderByExpr

java.lang.Object
  extended by org.apache.empire.db.DBObject
      extended by org.apache.empire.db.DBExpr
          extended by org.apache.empire.db.expr.order.DBOrderByExpr
All Implemented Interfaces:
Serializable

public class DBOrderByExpr
extends DBExpr

See Also:
Serialized Form

Field Summary
protected  boolean desc
           
protected  DBColumnExpr expr
           
 
Fields inherited from class org.apache.empire.db.DBExpr
CTX_ALIAS, CTX_ALL, CTX_DEFAULT, CTX_FULLNAME, CTX_NAME, CTX_NOPARENTHESES, CTX_VALUE
 
Constructor Summary
DBOrderByExpr(DBColumnExpr expr, boolean desc)
          Construct a new DBOrderByInfo object set the specified parameters to this object.
 
Method Summary
 void addReferencedColumns(Set<DBColumn> list)
          Internal function to obtain all DBColumnExpr-objects used by this expression.
 void addSQL(StringBuilder buf, long context)
          Adds a column expression to the orderBy clause followed by the desc keyword if the order should be descending
 DBColumn getColumn()
           
 DBColumnExpr getColumnExpr()
           
 DBDatabase getDatabase()
          Returns the database object to which this object belongs to.
 boolean isDescending()
           
 void setDescending(boolean descending)
           
 
Methods inherited from class org.apache.empire.db.DBExpr
getObjectValue, getValueClass
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

expr

protected final DBColumnExpr expr

desc

protected boolean desc
Constructor Detail

DBOrderByExpr

public DBOrderByExpr(DBColumnExpr expr,
                     boolean desc)
Construct a new DBOrderByInfo object set the specified parameters to this object.

Parameters:
expr - the column
desc - set true for descending or false for ascending
Method Detail

getColumnExpr

public DBColumnExpr getColumnExpr()

getColumn

public DBColumn getColumn()

isDescending

public boolean isDescending()

setDescending

public void setDescending(boolean descending)

getDatabase

public DBDatabase getDatabase()
Description copied from class: DBObject
Returns the database object to which this object belongs to. For the database object itself this function will return the this pointer.

Specified by:
getDatabase in class DBObject
Returns:
the database object

addReferencedColumns

public void addReferencedColumns(Set<DBColumn> list)
Description copied from class: DBExpr
Internal function to obtain all DBColumnExpr-objects used by this expression.

Specified by:
addReferencedColumns in class DBExpr
Parameters:
list - list to which all used column expressions must be added

addSQL

public void addSQL(StringBuilder buf,
                   long context)
Adds a column expression to the orderBy clause followed by the desc keyword if the order should be descending

Specified by:
addSQL in class DBExpr
Parameters:
buf - the SQL-Command
context - the current SQL-Command context


Copyright © 2008–2014 Apache Software Foundation. All rights reserved.