com.datastax.driver.core.querybuilder
Class Select.Selection

java.lang.Object
  extended by com.datastax.driver.core.querybuilder.Select.Builder
      extended by com.datastax.driver.core.querybuilder.Select.Selection
Direct Known Subclasses:
Select.SelectionOrAlias
Enclosing class:
Select

public abstract static class Select.Selection
extends Select.Builder

An Selection clause for an in-construction SELECT statement.


Constructor Summary
Select.Selection()
           
 
Method Summary
abstract  Select.Builder all()
          Selects all columns (i.e.
abstract  Select.SelectionOrAlias column(String name)
          Selects the provided column.
abstract  Select.Builder countAll()
          Selects the count of all returned rows (i.e.
 Select.Selection distinct()
          Uses DISTINCT selection.
abstract  Select.SelectionOrAlias fcall(String name, Object... parameters)
          Creates a function call.
abstract  Select.SelectionOrAlias ttl(String name)
          Selects the ttl of provided column.
abstract  Select.SelectionOrAlias writeTime(String name)
          Selects the write time of provided column.
 
Methods inherited from class com.datastax.driver.core.querybuilder.Select.Builder
from, from, from
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Select.Selection

public Select.Selection()
Method Detail

distinct

public Select.Selection distinct()
Uses DISTINCT selection.

Returns:
this in-build SELECT statement.

all

public abstract Select.Builder all()
Selects all columns (i.e. "SELECT * ...")

Returns:
an in-build SELECT statement.
Throws:
IllegalStateException - if some columns had already been selected for this builder.

countAll

public abstract Select.Builder countAll()
Selects the count of all returned rows (i.e. "SELECT count(*) ...").

Returns:
an in-build SELECT statement.
Throws:
IllegalStateException - if some columns had already been selected for this builder.

column

public abstract Select.SelectionOrAlias column(String name)
Selects the provided column.

Parameters:
name - the new column name to add.
Returns:
this in-build SELECT statement

writeTime

public abstract Select.SelectionOrAlias writeTime(String name)
Selects the write time of provided column.

This is a shortcut for fcall("writetime", QueryBuilder.column(name)).

Parameters:
name - the name of the column to select the write time of.
Returns:
this in-build SELECT statement

ttl

public abstract Select.SelectionOrAlias ttl(String name)
Selects the ttl of provided column.

This is a shortcut for fcall("ttl", QueryBuilder.column(name)).

Parameters:
name - the name of the column to select the ttl of.
Returns:
this in-build SELECT statement

fcall

public abstract Select.SelectionOrAlias fcall(String name,
                                              Object... parameters)
Creates a function call.

Please note that the parameters are interpreted as values, and so fcall("textToBlob", "foo") will generate the string "textToBlob('foo')". If you want to generate "textToBlob(foo)", i.e. if the argument must be interpreted as a column name (in a select clause), you will need to use the QueryBuilder.column(java.lang.String) method, and so fcall("textToBlob", QueryBuilder.column(foo).



Copyright © 2013. All rights reserved.