public static class Select.SelectionOrAlias extends Select.Selection
Select.Selection
in that you can add an
alias for the previously selected item through as(java.lang.String)
.Modifier and Type | Method and Description |
---|---|
Select.Builder |
all()
Selects all columns (i.e.
|
Select.Selection |
as(String alias)
Adds an alias for the just selected item.
|
Select.SelectionOrAlias |
column(String name)
Selects the provided column.
|
Select.Builder |
countAll()
Selects the count of all returned rows (i.e.
|
Select.SelectionOrAlias |
fcall(String name,
Object... parameters)
Creates a function call.
|
Select |
from(String keyspace,
String table)
Adds the table to select from.
|
Select |
from(TableMetadata table)
Adds the table to select from.
|
Select.SelectionOrAlias |
raw(String rawString)
Selects the provided raw expression.
|
Select.SelectionOrAlias |
ttl(String name)
Selects the ttl of provided column.
|
Select.SelectionOrAlias |
writeTime(String name)
Selects the write time of provided column.
|
distinct
from
public Select.Selection as(String alias)
alias
- the name of the alias to use.public Select.Builder all()
all
in class Select.Selection
IllegalStateException
- if some columns had already been selected for this builder.public Select.Builder countAll()
countAll
in class Select.Selection
IllegalStateException
- if some columns had already been selected for this builder.public Select.SelectionOrAlias column(String name)
column
in class Select.Selection
name
- the new column name to add.public Select.SelectionOrAlias raw(String rawString)
Select.Selection
to
avoid breaking binary compatibility. This means that it is not accessible directly via the fluent API (you need
a cast). This shouldn't be a problem for regular clients because they will use other methods of the DSL
(fcall
, etc.) rather than provide a raw string.rawString
- the raw expression to add.public Select.SelectionOrAlias writeTime(String name)
fcall("writetime", QueryBuilder.column(name))
.writeTime
in class Select.Selection
name
- the name of the column to select the write time of.public Select.SelectionOrAlias ttl(String name)
fcall("ttl", QueryBuilder.column(name))
.ttl
in class Select.Selection
name
- the name of the column to select the ttl of.public Select.SelectionOrAlias fcall(String name, Object... parameters)
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)
.fcall
in class Select.Selection
name
- the name of the function.parameters
- the parameters for the function call.public Select from(String keyspace, String table)
from
in class Select.Builder
keyspace
- the name of the keyspace to select from.table
- the name of the table to select from.keyspace.table
.public Select from(TableMetadata table)
from
in class Select.Builder
table
- the table to select from.table
.