/** * Adds a prepared {@code LIMIT} clause to this statement. * * @param marker the marker to use for the limit. * @return this statement. * @throws IllegalStateException if a {@code LIMIT} clause has already been provided. */ public Select limit(BindMarker marker) { if (this.limit != null) throw new IllegalStateException("A LIMIT value has already been provided"); this.limit = marker; checkForBindMarkers(marker); return this; }
/** * Adds an {@code ORDER BY} clause to this statement. * * @param orderings the orderings to define for this query. * @return this statement. * @throws IllegalStateException if an {@code ORDER BY} clause has already been provided. */ public Select orderBy(Ordering... orderings) { if (this.orderings != null) throw new IllegalStateException("An ORDER BY clause has already been provided"); if (orderings.length == 0) throw new IllegalArgumentException( "Invalid ORDER BY argument, the orderings must not be empty."); this.orderings = Arrays.asList(orderings); for (Ordering ordering : orderings) checkForBindMarkers(ordering); return this; }
/** * Adds a prepared {@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 marker the marker to use for the limit per partition. * @return this statement. * @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(BindMarker marker) { 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 = marker; checkForBindMarkers(marker); return this; }
/** * Adds a prepared {@code LIMIT} clause to this statement. * * @param marker the marker to use for the limit. * @return this statement. * @throws IllegalStateException if a {@code LIMIT} clause has already been * provided. */ public Select limit(BindMarker marker) { if (this.limit != null) throw new IllegalStateException("A LIMIT value has already been provided"); this.limit = marker; checkForBindMarkers(marker); return this; }
/** * Adds a prepared {@code LIMIT} clause to this statement. * * @param marker the marker to use for the limit. * @return this statement. * @throws IllegalStateException if a {@code LIMIT} clause has already been * provided. */ public Select limit(BindMarker marker) { if (this.limit != null) throw new IllegalStateException("A LIMIT value has already been provided"); this.limit = marker; checkForBindMarkers(marker); return this; }
/** * Adds a prepared {@code LIMIT} clause to this statement. * * @param marker the marker to use for the limit. * @return this statement. * @throws IllegalStateException if a {@code LIMIT} clause has already been * provided. */ public Select limit(BindMarker marker) { if (this.limit != null) throw new IllegalStateException("A LIMIT value has already been provided"); this.limit = marker; checkForBindMarkers(marker); return this; }
/** * Adds a prepared LIMIT clause to this statement. * * @param marker the marker to use for the limit. * @return this statement. * * @throws IllegalStateException if a LIMIT clause has already been * provided. */ public Select limit(BindMarker marker) { if (this.limit != null) throw new IllegalStateException("A LIMIT value has already been provided"); this.limit = marker; checkForBindMarkers(marker); return this; }
/** * Adds an ORDER BY clause to this statement. * * @param orderings the orderings to define for this query. * @return this statement. * @throws IllegalStateException if an ORDER BY clause has already been * provided. */ public Select orderBy(Ordering... orderings) { if (this.orderings != null) throw new IllegalStateException("An ORDER BY clause has already been provided"); this.orderings = Arrays.asList(orderings); for (int i = 0; i < orderings.length; i++) checkForBindMarkers(orderings[i]); return this; }
/** * Adds an ORDER BY clause to this statement. * * @param orderings the orderings to define for this query. * @return this statement. * @throws IllegalStateException if an ORDER BY clause has already been * provided. */ public Select orderBy(Ordering... orderings) { if (this.orderings != null) throw new IllegalStateException("An ORDER BY clause has already been provided"); this.orderings = Arrays.asList(orderings); for (int i = 0; i < orderings.length; i++) checkForBindMarkers(orderings[i]); return this; }
/** * Adds an ORDER BY clause to this statement. * * @param orderings the orderings to define for this query. * @return this statement. * * @throws IllegalStateException if an ORDER BY clause has already been * provided. */ public Select orderBy(Ordering... orderings) { if (this.orderings != null) throw new IllegalStateException("An ORDER BY clause has already been provided"); this.orderings = Arrays.asList(orderings); for (int i = 0; i < orderings.length; i++) checkForBindMarkers(orderings[i]); return this; }
/** * Adds an ORDER BY clause to this statement. * * @param orderings the orderings to define for this query. * @return this statement. * @throws IllegalStateException if an ORDER BY clause has already been * provided. */ public Select orderBy(Ordering... orderings) { if (this.orderings != null) throw new IllegalStateException("An ORDER BY clause has already been provided"); this.orderings = Arrays.asList(orderings); for (int i = 0; i < orderings.length; i++) checkForBindMarkers(orderings[i]); return this; }
/** * Adds a LIMIT clause to this statement. * * @param limit the limit to set. * @return this statement. * * @throws IllegalArgumentException if {@code limit >e; 0}. * @throws IllegalStateException if a 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; checkForBindMarkers(null); return this; }
/** * Adds a prepared {@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 marker the marker to use for the limit per partition. * @return this statement. * @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(BindMarker marker) { 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 = marker; checkForBindMarkers(marker); return this; }
/** * Adds a prepared {@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 marker the marker to use for the limit per partition. * @return this statement. * @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(BindMarker marker) { 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 = marker; checkForBindMarkers(marker); return this; }
/** * Adds a prepared {@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 marker the marker to use for the limit per partition. * @return this statement. * @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(BindMarker marker) { 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 = marker; checkForBindMarkers(marker); return this; }