org.castor.cpa.persistence.sql.query
Class Select

java.lang.Object
  extended by org.castor.cpa.persistence.sql.query.QueryObject
      extended by org.castor.cpa.persistence.sql.query.Select

public final class Select
extends QueryObject

Class to generate SQL select query statements.
Note: Be aware that the SQL statement will be invalid for empty compound conditions.

Version:
$Revision$ $Date: 2009-07-13 17:22:43 (Mon, 27 Jul 2009) $
Author:
Ahmad Hassan, Ralf Joachim

Constructor Summary
Select(Qualifier qualifier)
          Construct a SQL select statement that selects records of the table provided.
Select(java.lang.String name)
          Construct a SQL select statement that selects records of the table provided.
 
Method Summary
 void addSelect(Column name)
          Appends the provided field to the list of fields to be fetched from table.
 Condition getCondition()
          Get condition that specifies which records to select.
 void setCondition(Condition condition)
          Set condition that specifies which records to select.
 void toString(QueryContext ctx)
          Append a string representation of the object to the given QueryContext.
 
Methods inherited from class org.castor.cpa.persistence.sql.query.QueryObject
toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Select

public Select(java.lang.String name)
Construct a SQL select statement that selects records of the table provided.

Parameters:
name - Name of the table to select records of.

Select

public Select(Qualifier qualifier)
Construct a SQL select statement that selects records of the table provided.

Parameters:
qualifier - Qualifier to select records of.
Method Detail

addSelect

public void addSelect(Column name)
Appends the provided field to the list of fields to be fetched from table.

Parameters:
name - Column object representing a column to be fetched.

getCondition

public Condition getCondition()
Get condition that specifies which records to select.

Returns:
Condition that specifies which records to select.

setCondition

public void setCondition(Condition condition)
Set condition that specifies which records to select.

Parameters:
condition - Condition that specifies which records to select.

toString

public void toString(QueryContext ctx)
Description copied from class: QueryObject
Append a string representation of the object to the given QueryContext. In general, this toString method appends a string that "textually represents" this object. The result should be a string in valid SQL syntax. It is required that all subclasses override this method.

Specified by:
toString in class QueryObject
Parameters:
ctx - QueryContext to append the string representation of the object to.


Intalio Inc. (C) 1999-2008. All rights reserved http://www.intalio.com