/** * Adds a {@code LIMIT} clause to this statement. * * @param limit the limit to set. * @return this statement. * @throws IllegalArgumentException if {@code limit <= 0}. * @throws IllegalStateException if a {@code LIMIT} clause has already been provided. */ public Select limit(int limit) { if (limit <= 0) throw new IllegalArgumentException("Invalid LIMIT value, must be strictly positive"); if (this.limit != null) throw new IllegalStateException("A LIMIT value has already been provided"); this.limit = limit; setDirty(); return this; }
/** * Adds a {@code PER PARTITION LIMIT} clause to this statement. * * <p>Note: support for {@code PER PARTITION LIMIT} clause is only available from Cassandra 3.6 * onwards. * * @param perPartitionLimit the limit to set per partition. * @return this statement. * @throws IllegalArgumentException if {@code perPartitionLimit <= 0}. * @throws IllegalStateException if a {@code PER PARTITION LIMIT} clause has already been * provided. * @throws IllegalStateException if this statement is a {@code SELECT DISTINCT} statement. */ public Select perPartitionLimit(int perPartitionLimit) { if (perPartitionLimit <= 0) throw new IllegalArgumentException( "Invalid PER PARTITION LIMIT value, must be strictly positive"); if (this.perPartitionLimit != null) throw new IllegalStateException("A PER PARTITION LIMIT value has already been provided"); if (isDistinct) throw new IllegalStateException( "PER PARTITION LIMIT is not allowed with SELECT DISTINCT queries"); this.perPartitionLimit = perPartitionLimit; setDirty(); return this; }
/** * Adds a {@code LIMIT} clause to this statement. * * @param limit the limit to set. * @return this statement. * @throws IllegalArgumentException if {@code limit <= 0}. * @throws IllegalStateException if a {@code LIMIT} clause has already been * provided. */ public Select limit(int limit) { if (limit <= 0) throw new IllegalArgumentException("Invalid LIMIT value, must be strictly positive"); if (this.limit != null) throw new IllegalStateException("A LIMIT value has already been provided"); this.limit = limit; setDirty(); return this; }
/** * Adds a {@code LIMIT} clause to this statement. * * @param limit the limit to set. * @return this statement. * @throws IllegalArgumentException if {@code limit <= 0}. * @throws IllegalStateException if a {@code LIMIT} clause has already been * provided. */ public Select limit(int limit) { if (limit <= 0) throw new IllegalArgumentException("Invalid LIMIT value, must be strictly positive"); if (this.limit != null) throw new IllegalStateException("A LIMIT value has already been provided"); this.limit = limit; setDirty(); return this; }
/** * Adds a {@code LIMIT} clause to this statement. * * @param limit the limit to set. * @return this statement. * @throws IllegalArgumentException if {@code limit <= 0}. * @throws IllegalStateException if a {@code LIMIT} clause has already been * provided. */ public Select limit(int limit) { if (limit <= 0) throw new IllegalArgumentException("Invalid LIMIT value, must be strictly positive"); if (this.limit != null) throw new IllegalStateException("A LIMIT value has already been provided"); this.limit = limit; setDirty(); return this; }
/** * Adds a {@code PER PARTITION LIMIT} clause to this statement. * <p> * Note: support for {@code PER PARTITION LIMIT} clause is only available from * Cassandra 3.6 onwards. * * @param perPartitionLimit the limit to set per partition. * @return this statement. * @throws IllegalArgumentException if {@code perPartitionLimit <= 0}. * @throws IllegalStateException if a {@code PER PARTITION LIMIT} clause has already been * provided. * @throws IllegalStateException if this statement is a {@code SELECT DISTINCT} statement. */ public Select perPartitionLimit(int perPartitionLimit) { if (perPartitionLimit <= 0) throw new IllegalArgumentException("Invalid PER PARTITION LIMIT value, must be strictly positive"); if (this.perPartitionLimit != null) throw new IllegalStateException("A PER PARTITION LIMIT value has already been provided"); if (isDistinct) throw new IllegalStateException("PER PARTITION LIMIT is not allowed with SELECT DISTINCT queries"); this.perPartitionLimit = perPartitionLimit; setDirty(); return this; }
/** * Adds a {@code PER PARTITION LIMIT} clause to this statement. * <p> * Note: support for {@code PER PARTITION LIMIT} clause is only available from * Cassandra 3.6 onwards. * * @param perPartitionLimit the limit to set per partition. * @return this statement. * @throws IllegalArgumentException if {@code perPartitionLimit <= 0}. * @throws IllegalStateException if a {@code PER PARTITION LIMIT} clause has already been * provided. * @throws IllegalStateException if this statement is a {@code SELECT DISTINCT} statement. */ public Select perPartitionLimit(int perPartitionLimit) { if (perPartitionLimit <= 0) throw new IllegalArgumentException("Invalid PER PARTITION LIMIT value, must be strictly positive"); if (this.perPartitionLimit != null) throw new IllegalStateException("A PER PARTITION LIMIT value has already been provided"); if (isDistinct) throw new IllegalStateException("PER PARTITION LIMIT is not allowed with SELECT DISTINCT queries"); this.perPartitionLimit = perPartitionLimit; setDirty(); return this; }
/** * Adds a {@code PER PARTITION LIMIT} clause to this statement. * <p> * Note: support for {@code PER PARTITION LIMIT} clause is only available from * Cassandra 3.6 onwards. * * @param perPartitionLimit the limit to set per partition. * @return this statement. * @throws IllegalArgumentException if {@code perPartitionLimit <= 0}. * @throws IllegalStateException if a {@code PER PARTITION LIMIT} clause has already been * provided. * @throws IllegalStateException if this statement is a {@code SELECT DISTINCT} statement. */ public Select perPartitionLimit(int perPartitionLimit) { if (perPartitionLimit <= 0) throw new IllegalArgumentException("Invalid PER PARTITION LIMIT value, must be strictly positive"); if (this.perPartitionLimit != null) throw new IllegalStateException("A PER PARTITION LIMIT value has already been provided"); if (isDistinct) throw new IllegalStateException("PER PARTITION LIMIT is not allowed with SELECT DISTINCT queries"); this.perPartitionLimit = perPartitionLimit; setDirty(); return this; }