Class Select
- java.lang.Object
-
- com.datastax.driver.core.Statement
-
- com.datastax.driver.core.RegularStatement
-
- com.datastax.driver.core.querybuilder.BuiltStatement
-
- com.datastax.driver.core.querybuilder.Select
-
public class Select extends BuiltStatement
A built SELECT statement.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classSelect.BuilderAn in-construction SELECT statement.static classSelect.OptionsThe options of a SELECT statement.static classSelect.SelectionAn Selection clause for an in-construction SELECT statement.static classSelect.SelectionOrAliasAn Selection clause for an in-construction SELECT statement.static classSelect.WhereTheWHEREclause of aSELECTstatement.
-
Field Summary
-
Fields inherited from class com.datastax.driver.core.Statement
idempotent, NULL_PAYLOAD_VALUE
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description SelectallowFiltering()Adds anALLOW FILTERINGdirective to this statement.SelectbypassCache()Adds onBYPASS CACHEclause to this statement.SelectgroupBy(Object... columns)Adds aGROUP BYclause to this statement.Selectlimit(int limit)Adds aLIMITclause to this statement.Selectlimit(BindMarker marker)Adds a preparedLIMITclause to this statement.SelectorderBy(Ordering... orderings)Adds anORDER BYclause to this statement.SelectperPartitionLimit(int perPartitionLimit)Adds aPER PARTITION LIMITclause to this statement.SelectperPartitionLimit(BindMarker marker)Adds a preparedPER PARTITION LIMITclause to this statement.Select.Optionsusing(Using using)Adds a new options for this SELECT statement.Select.Wherewhere()Returns aWHEREstatement for this query without adding clause.Select.Wherewhere(Clause clause)Adds aWHEREclause to this statement.-
Methods inherited from class com.datastax.driver.core.querybuilder.BuiltStatement
escapeId, getKeyspace, getNamedValues, getObject, getObject, getQueryString, getRoutingKey, getValues, hasValues, isIdempotent, setForceNoValues, toString, usesNamedValues
-
Methods inherited from class com.datastax.driver.core.RegularStatement
getQueryString, hasValues, requestSizeInBytes
-
Methods inherited from class com.datastax.driver.core.Statement
disableTracing, enableTracing, getConsistencyLevel, getDefaultTimestamp, getFetchSize, getHost, getLastHost, getNowInSeconds, getOutgoingPayload, getPartitioner, getReadTimeoutMillis, getRetryPolicy, getSerialConsistencyLevel, isBatchIdempotent, isLWT, isTracing, setConsistencyLevel, setDefaultTimestamp, setFetchSize, setHost, setIdempotent, setLastHost, setNowInSeconds, setOutgoingPayload, setPagingState, setPagingState, setPagingStateUnsafe, setReadTimeoutMillis, setRetryPolicy, setSerialConsistencyLevel
-
-
-
-
Method Detail
-
where
public Select.Where where(Clause clause)
Adds aWHEREclause to this statement.This is a shorter/more readable version for
where().and(clause).- Parameters:
clause- the clause to add.- Returns:
- the where clause of this query to which more clause can be added.
-
where
public Select.Where where()
Returns aWHEREstatement for this query without adding clause.- Returns:
- the where clause of this query to which more clause can be added.
-
using
public Select.Options using(Using using)
Adds a new options for this SELECT statement.- Parameters:
using- the option to add.- Returns:
- the options of this SELECT statement.
-
orderBy
public Select orderBy(Ordering... orderings)
Adds anORDER BYclause to this statement.- Parameters:
orderings- the orderings to define for this query.- Returns:
- this statement.
- Throws:
IllegalStateException- if anORDER BYclause has already been provided.
-
groupBy
public Select groupBy(Object... columns)
Adds aGROUP BYclause to this statement.Note: support for
GROUP BYclause is only available from Cassandra 3.10 onwards.- Parameters:
columns- the columns to group by.- Returns:
- this statement.
- Throws:
IllegalStateException- if aGROUP BYclause has already been provided.
-
limit
public Select limit(int limit)
Adds aLIMITclause to this statement.- Parameters:
limit- the limit to set.- Returns:
- this statement.
- Throws:
IllegalArgumentException- iflimit <= 0.IllegalStateException- if aLIMITclause has already been provided.
-
limit
public Select limit(BindMarker marker)
Adds a preparedLIMITclause to this statement.- Parameters:
marker- the marker to use for the limit.- Returns:
- this statement.
- Throws:
IllegalStateException- if aLIMITclause has already been provided.
-
perPartitionLimit
public Select perPartitionLimit(int perPartitionLimit)
Adds aPER PARTITION LIMITclause to this statement.Note: support for
PER PARTITION LIMITclause is only available from Cassandra 3.6 onwards.- Parameters:
perPartitionLimit- the limit to set per partition.- Returns:
- this statement.
- Throws:
IllegalArgumentException- ifperPartitionLimit <= 0.IllegalStateException- if aPER PARTITION LIMITclause has already been provided.IllegalStateException- if this statement is aSELECT DISTINCTstatement.
-
perPartitionLimit
public Select perPartitionLimit(BindMarker marker)
Adds a preparedPER PARTITION LIMITclause to this statement.Note: support for
PER PARTITION LIMITclause is only available from Cassandra 3.6 onwards.- Parameters:
marker- the marker to use for the limit per partition.- Returns:
- this statement.
- Throws:
IllegalStateException- if aPER PARTITION LIMITclause has already been provided.IllegalStateException- if this statement is aSELECT DISTINCTstatement.
-
allowFiltering
public Select allowFiltering()
Adds anALLOW FILTERINGdirective to this statement.- Returns:
- this statement.
-
bypassCache
public Select bypassCache()
Adds onBYPASS CACHEclause to this statement.- Returns:
- this statement.
-
-