Class Select


  • public class Select
    extends BuiltStatement
    A built SELECT statement.
    • Method Detail

      • where

        public Select.Where where​(Clause clause)
        Adds a WHERE clause 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 a WHERE statement 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 an ORDER BY clause to this statement.
        Parameters:
        orderings - the orderings to define for this query.
        Returns:
        this statement.
        Throws:
        IllegalStateException - if an ORDER BY clause has already been provided.
      • groupBy

        public Select groupBy​(Object... columns)
        Adds a GROUP BY clause to this statement.

        Note: support for GROUP BY clause is only available from Cassandra 3.10 onwards.

        Parameters:
        columns - the columns to group by.
        Returns:
        this statement.
        Throws:
        IllegalStateException - if a GROUP BY clause has already been provided.
      • limit

        public Select limit​(int limit)
        Adds a LIMIT clause to this statement.
        Parameters:
        limit - the limit to set.
        Returns:
        this statement.
        Throws:
        IllegalArgumentException - if limit <= 0.
        IllegalStateException - if a LIMIT clause has already been provided.
      • limit

        public Select limit​(BindMarker marker)
        Adds a prepared LIMIT clause to this statement.
        Parameters:
        marker - the marker to use for the limit.
        Returns:
        this statement.
        Throws:
        IllegalStateException - if a LIMIT clause has already been provided.
      • perPartitionLimit

        public Select perPartitionLimit​(int perPartitionLimit)
        Adds a PER PARTITION LIMIT clause to this statement.

        Note: support for PER PARTITION LIMIT clause is only available from Cassandra 3.6 onwards.

        Parameters:
        perPartitionLimit - the limit to set per partition.
        Returns:
        this statement.
        Throws:
        IllegalArgumentException - if perPartitionLimit <= 0.
        IllegalStateException - if a PER PARTITION LIMIT clause has already been provided.
        IllegalStateException - if this statement is a SELECT DISTINCT statement.
      • perPartitionLimit

        public Select perPartitionLimit​(BindMarker marker)
        Adds a prepared PER PARTITION LIMIT clause to this statement.

        Note: support for PER PARTITION LIMIT clause 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 a PER PARTITION LIMIT clause has already been provided.
        IllegalStateException - if this statement is a SELECT DISTINCT statement.
      • allowFiltering

        public Select allowFiltering()
        Adds an ALLOW FILTERING directive to this statement.
        Returns:
        this statement.
      • bypassCache

        public Select bypassCache()
        Adds on BYPASS CACHE clause to this statement.
        Returns:
        this statement.