Class Columns
java.lang.Object
org.springframework.data.cassandra.core.query.Columns
- All Implemented Interfaces:
Iterable<ColumnName>
Value object to abstract column names involved in a CQL query. Columns can be constructed from an array of names and
included using a
Columns.Selector
.- Since:
- 2.0
- Author:
- Mark Paluch
- See Also:
-
CqlIdentifier
ColumnName
Columns.Selector
Columns.FunctionCall
Columns.ColumnSelector
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
Column selection.static class
Function call selector with alias support.static interface
Strategy interface to render a column selection. -
Method Summary
Modifier and TypeMethodDescriptionReturns a newColumns
consisting of theColumnName
s of the currentColumns
combined with the given ones.static Columns
empty()
Create an emptyColumns
instance without any columns.boolean
static Columns
from
(com.datastax.oss.driver.api.core.CqlIdentifier... columnNames) Create aColumns
givencolumnNames
.static Columns
Create aColumns
givencolumnNames
.getSelector
(ColumnName columnName) int
hashCode()
include
(com.datastax.oss.driver.api.core.CqlIdentifier columnName) Include columncolumnName
to the selection.Include columncolumnName
to the selection.boolean
isEmpty()
iterator()
select
(com.datastax.oss.driver.api.core.CqlIdentifier columnName, Columns.Selector selector) Include columncolumnName
withColumns.Selector
.select
(String columnName, Columns.Selector selector) Include columncolumnName
withColumns.Selector
.toString()
ttl
(com.datastax.oss.driver.api.core.CqlIdentifier columnName) Include columncolumnName
as TTL value in the selection.Include columncolumnName
as TTL value in the selection.Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
Method Details
-
empty
Create an emptyColumns
instance without any columns.- Returns:
- an empty
Columns
instance.
-
from
Create aColumns
givencolumnNames
. Individual column names can be either quoted or unquoted.- Parameters:
columnNames
- must not be null.- Returns:
- the
Columns
object forcolumnNames
.
-
from
Create aColumns
givencolumnNames
.- Parameters:
columnNames
- must not be null.- Returns:
- the
Columns
object forcolumnNames
.
-
include
Include columncolumnName
to the selection. Column inclusion overrides an existing selection for the column name.- Parameters:
columnName
- must not be null.- Returns:
- a new
Columns
object containing all column definitions and the includedcolumnName
.
-
include
Include columncolumnName
to the selection. Column inclusion overrides an existing selection for the column name.- Parameters:
columnName
- must not be null.- Returns:
- a new
Columns
object containing all column definitions and the includedcolumnName
.
-
ttl
Include columncolumnName
as TTL value in the selection. This column selection overrides an existing selection for the column name.- Parameters:
columnName
- must not be null.- Returns:
- a new
Columns
object containing all column definitions and the TTL forcolumnName
.
-
ttl
Include columncolumnName
as TTL value in the selection. This column selection overrides an existing selection for the column name.- Parameters:
columnName
- must not be null.- Returns:
- a new
Columns
object containing all column definitions and the TTL forcolumnName
.
-
select
Include columncolumnName
withColumns.Selector
. This column selection overrides an existing selection for the column name.- Parameters:
columnName
- must not be null.- Returns:
- a new
Columns
object containing all column definitions and the selectedcolumnName
.
-
select
public Columns select(com.datastax.oss.driver.api.core.CqlIdentifier columnName, Columns.Selector selector) Include columncolumnName
withColumns.Selector
. This column selection overrides an existing selection for the column name.- Parameters:
columnName
- must not be null.- Returns:
- a new
Columns
object containing all column definitions and the selectedcolumnName
.
-
isEmpty
public boolean isEmpty()- Returns:
- true if no columns were specified and this
Columns
object is empty.
-
and
Returns a newColumns
consisting of theColumnName
s of the currentColumns
combined with the given ones. ExistingColumnName
s are overwritten if specified withincolumns
. -
iterator
- Specified by:
iterator
in interfaceIterable<ColumnName>
-
getSelector
- Parameters:
columnName
- must not be null.- Returns:
- the
Optional
Columns.Selector
forColumnName
.
-
equals
-
hashCode
public int hashCode() -
toString
-