org.apache.oozie.util.db
Class SqlStatement.Select

java.lang.Object
  extended by org.apache.oozie.util.db.SqlStatement
      extended by org.apache.oozie.util.db.SqlStatement.Select
Enclosing class:
SqlStatement

public static class SqlStatement.Select
extends SqlStatement

Select Statement generator. Generate the SQL Statement for select statements. Provide methods to add WHERE clause, ORDER BY clause, FOR UPDATE clause.


Nested Class Summary
 
Nested classes/interfaces inherited from class org.apache.oozie.util.db.SqlStatement
SqlStatement.Condition, SqlStatement.Delete, SqlStatement.Insert, SqlStatement.ResultSetReader, SqlStatement.Select, SqlStatement.Update
 
Field Summary
 
Fields inherited from class org.apache.oozie.util.db.SqlStatement
forUpdate, sb, values
 
Method Summary
 SqlStatement.Select forUpdate()
          Set the "for update" flag to lock the rows for updating
 SqlStatement.Select limit(int offset, int limit)
          Setting the offset and limit for LIMIT clause
 SqlStatement.Select orderBy(Schema.Column column, boolean order)
          Sets the column to sort and the order of sort
 SqlStatement.Select orderBy(Schema.Column column0, boolean order0, Schema.Column column1, boolean order1)
          To sort 2 columns
 String toString()
          Generate the SQL Select Statement with conditions and other clauses that were set
 SqlStatement.Select where(SqlStatement.Condition condition)
          Set the condition for where clause
 
Methods inherited from class org.apache.oozie.util.db.SqlStatement
and, between, deleteFrom, getCount, getNewStatementWithValues, greaterThan, greaterThanOrEqual, in, in, insertInto, isEqual, isLike, isNotEqual, isNotLike, isNotNull, isNull, lessThan, lessThanOrEqual, notBetween, notIn, notIn, or, parse, prepare, prepare, prepareAndSetValues, prepareForBatch, selectAllFrom, selectColumns, setValue, update
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Method Detail

where

public SqlStatement.Select where(SqlStatement.Condition condition)
Set the condition for where clause

Parameters:
condition - condition for where clause
Returns:
Select for cascading

orderBy

public SqlStatement.Select orderBy(Schema.Column column,
                                   boolean order)
Sets the column to sort and the order of sort

Parameters:
column - column to sort
order - true = ascending
Returns:
Select for cascading

orderBy

public SqlStatement.Select orderBy(Schema.Column column0,
                                   boolean order0,
                                   Schema.Column column1,
                                   boolean order1)
To sort 2 columns

Parameters:
column0 - First column to be sorted
order0 - true = ascending
column1 - Second column to be sorted
order1 - true = ascending
Returns:
Select for cascading

limit

public SqlStatement.Select limit(int offset,
                                 int limit)
Setting the offset and limit for LIMIT clause

Parameters:
offset -
limit -
Returns:
Select for cascading

forUpdate

public SqlStatement.Select forUpdate()
Set the "for update" flag to lock the rows for updating

Returns:
Select for cascading

toString

public String toString()
Generate the SQL Select Statement with conditions and other clauses that were set

Overrides:
toString in class Object


Copyright © 2013 Apache Software Foundation. All Rights Reserved.