@@ -19,6 +19,7 @@ import java.util.Collections;
|
||||
|
||||
import org.springframework.data.cassandra.core.cql.QueryOptions;
|
||||
import org.springframework.data.cassandra.core.cql.WriteOptions;
|
||||
import org.springframework.lang.Contract;
|
||||
import org.springframework.util.Assert;
|
||||
|
||||
import com.datastax.oss.driver.api.core.cql.BatchableStatement;
|
||||
@@ -58,6 +59,7 @@ public interface CassandraBatchOperations {
|
||||
* @return {@code this} {@link CassandraBatchOperations}.
|
||||
* @throws IllegalStateException if the batch was already executed.
|
||||
*/
|
||||
@Contract("_ -> this")
|
||||
CassandraBatchOperations withTimestamp(long timestamp);
|
||||
|
||||
/**
|
||||
@@ -68,6 +70,7 @@ public interface CassandraBatchOperations {
|
||||
* @throws IllegalStateException if the batch was already executed.
|
||||
* @since 4.4
|
||||
*/
|
||||
@Contract("_ -> this")
|
||||
CassandraBatchOperations withQueryOptions(QueryOptions options);
|
||||
|
||||
/**
|
||||
@@ -78,6 +81,7 @@ public interface CassandraBatchOperations {
|
||||
* @throws IllegalStateException if the batch was already executed.
|
||||
* @since 4.4
|
||||
*/
|
||||
@Contract("_ -> this")
|
||||
CassandraBatchOperations addStatement(BatchableStatement<?> statement);
|
||||
|
||||
/**
|
||||
@@ -88,6 +92,7 @@ public interface CassandraBatchOperations {
|
||||
* @throws IllegalStateException if the batch was already executed.
|
||||
* @since 4.4
|
||||
*/
|
||||
@Contract("_ -> this")
|
||||
CassandraBatchOperations addStatements(BatchableStatement<?>... statements);
|
||||
|
||||
/**
|
||||
@@ -98,6 +103,7 @@ public interface CassandraBatchOperations {
|
||||
* @throws IllegalStateException if the batch was already executed.
|
||||
* @since 4.4
|
||||
*/
|
||||
@Contract("_ -> this")
|
||||
CassandraBatchOperations addStatements(Iterable<? extends BatchableStatement<?>> statements);
|
||||
|
||||
/**
|
||||
@@ -109,6 +115,7 @@ public interface CassandraBatchOperations {
|
||||
* @throws IllegalStateException if the batch was already executed.
|
||||
* @since 3.2.2
|
||||
*/
|
||||
@Contract("_, _ -> this")
|
||||
default CassandraBatchOperations insert(Object entity, WriteOptions options) {
|
||||
|
||||
Assert.notNull(entity, "Entity must not be null");
|
||||
@@ -123,6 +130,7 @@ public interface CassandraBatchOperations {
|
||||
* @return {@code this} {@link CassandraBatchOperations}.
|
||||
* @throws IllegalStateException if the batch was already executed.
|
||||
*/
|
||||
@Contract("_ -> this")
|
||||
CassandraBatchOperations insert(Object... entities);
|
||||
|
||||
/**
|
||||
@@ -132,6 +140,7 @@ public interface CassandraBatchOperations {
|
||||
* @return {@code this} {@link CassandraBatchOperations}.
|
||||
* @throws IllegalStateException if the batch was already executed.
|
||||
*/
|
||||
@Contract("_ -> this")
|
||||
CassandraBatchOperations insert(Iterable<?> entities);
|
||||
|
||||
/**
|
||||
@@ -144,6 +153,7 @@ public interface CassandraBatchOperations {
|
||||
* @since 2.0
|
||||
* @see InsertOptions
|
||||
*/
|
||||
@Contract("_, _ -> this")
|
||||
CassandraBatchOperations insert(Iterable<?> entities, WriteOptions options);
|
||||
|
||||
/**
|
||||
@@ -155,6 +165,7 @@ public interface CassandraBatchOperations {
|
||||
* @throws IllegalStateException if the batch was already executed.
|
||||
* @since 3.2.2
|
||||
*/
|
||||
@Contract("_, _ -> this")
|
||||
default CassandraBatchOperations update(Object entity, WriteOptions options) {
|
||||
|
||||
Assert.notNull(entity, "Entity must not be null");
|
||||
@@ -169,6 +180,7 @@ public interface CassandraBatchOperations {
|
||||
* @return {@code this} {@link CassandraBatchOperations}.
|
||||
* @throws IllegalStateException if the batch was already executed.
|
||||
*/
|
||||
@Contract("_ -> this")
|
||||
CassandraBatchOperations update(Object... entities);
|
||||
|
||||
/**
|
||||
@@ -178,6 +190,7 @@ public interface CassandraBatchOperations {
|
||||
* @return {@code this} {@link CassandraBatchOperations}.
|
||||
* @throws IllegalStateException if the batch was already executed.
|
||||
*/
|
||||
@Contract("_ -> this")
|
||||
CassandraBatchOperations update(Iterable<?> entities);
|
||||
|
||||
/**
|
||||
@@ -190,6 +203,7 @@ public interface CassandraBatchOperations {
|
||||
* @since 2.0
|
||||
* @see UpdateOptions
|
||||
*/
|
||||
@Contract("_, _ -> this")
|
||||
CassandraBatchOperations update(Iterable<?> entities, WriteOptions options);
|
||||
|
||||
/**
|
||||
@@ -201,6 +215,7 @@ public interface CassandraBatchOperations {
|
||||
* @throws IllegalStateException if the batch was already executed.
|
||||
* @since 3.2.2
|
||||
*/
|
||||
@Contract("_, _ -> this")
|
||||
default CassandraBatchOperations delete(Object entity, WriteOptions options) {
|
||||
|
||||
Assert.notNull(entity, "Entity must not be null");
|
||||
@@ -215,6 +230,7 @@ public interface CassandraBatchOperations {
|
||||
* @return {@code this} {@link CassandraBatchOperations}.
|
||||
* @throws IllegalStateException if the batch was already executed.
|
||||
*/
|
||||
@Contract("_ -> this")
|
||||
CassandraBatchOperations delete(Object... entities);
|
||||
|
||||
/**
|
||||
@@ -224,6 +240,7 @@ public interface CassandraBatchOperations {
|
||||
* @return {@code this} {@link CassandraBatchOperations}.
|
||||
* @throws IllegalStateException if the batch was already executed.
|
||||
*/
|
||||
@Contract("_ -> this")
|
||||
CassandraBatchOperations delete(Iterable<?> entities);
|
||||
|
||||
/**
|
||||
@@ -236,5 +253,6 @@ public interface CassandraBatchOperations {
|
||||
* @since 2.2
|
||||
* @see DeleteOptions
|
||||
*/
|
||||
@Contract("_, _ -> this")
|
||||
CassandraBatchOperations delete(Iterable<?> entities, WriteOptions options);
|
||||
}
|
||||
|
||||
@@ -16,6 +16,7 @@
|
||||
package org.springframework.data.cassandra.core;
|
||||
|
||||
import org.springframework.data.cassandra.core.query.Query;
|
||||
import org.springframework.lang.Contract;
|
||||
import org.springframework.util.Assert;
|
||||
|
||||
import com.datastax.oss.driver.api.core.CqlIdentifier;
|
||||
@@ -69,6 +70,7 @@ public interface ExecutableDeleteOperation {
|
||||
* @see #inTable(CqlIdentifier)
|
||||
* @see DeleteWithQuery
|
||||
*/
|
||||
@Contract("_ -> new")
|
||||
default DeleteWithQuery inTable(String table) {
|
||||
|
||||
Assert.hasText(table, "Table name must not be null or empty");
|
||||
@@ -87,6 +89,7 @@ public interface ExecutableDeleteOperation {
|
||||
* @see com.datastax.oss.driver.api.core.CqlIdentifier
|
||||
* @see DeleteWithQuery
|
||||
*/
|
||||
@Contract("_ -> new")
|
||||
DeleteWithQuery inTable(CqlIdentifier table);
|
||||
|
||||
}
|
||||
@@ -104,6 +107,7 @@ public interface ExecutableDeleteOperation {
|
||||
* @throws IllegalArgumentException if {@link Query} is {@literal null}.
|
||||
* @see TerminatingDelete
|
||||
*/
|
||||
@Contract("_ -> new")
|
||||
TerminatingDelete matching(Query query);
|
||||
|
||||
}
|
||||
|
||||
@@ -15,6 +15,7 @@
|
||||
*/
|
||||
package org.springframework.data.cassandra.core;
|
||||
|
||||
import org.springframework.lang.Contract;
|
||||
import org.springframework.util.Assert;
|
||||
|
||||
import com.datastax.oss.driver.api.core.CqlIdentifier;
|
||||
@@ -66,6 +67,7 @@ public interface ExecutableInsertOperation {
|
||||
* @throws IllegalArgumentException if {@link String table} is {@literal null} or empty.
|
||||
* @see InsertWithOptions
|
||||
*/
|
||||
@Contract("_ -> new")
|
||||
default InsertWithOptions<T> inTable(String table) {
|
||||
|
||||
Assert.hasText(table, "Table name must not be null or empty");
|
||||
@@ -84,6 +86,7 @@ public interface ExecutableInsertOperation {
|
||||
* @see com.datastax.oss.driver.api.core.CqlIdentifier
|
||||
* @see InsertWithOptions
|
||||
*/
|
||||
@Contract("_ -> new")
|
||||
InsertWithOptions<T> inTable(CqlIdentifier table);
|
||||
|
||||
}
|
||||
@@ -102,6 +105,7 @@ public interface ExecutableInsertOperation {
|
||||
* @see org.springframework.data.cassandra.core.InsertOptions
|
||||
* @see TerminatingInsert
|
||||
*/
|
||||
@Contract("_ -> new")
|
||||
TerminatingInsert<T> withOptions(InsertOptions insertOptions);
|
||||
|
||||
}
|
||||
|
||||
@@ -21,6 +21,7 @@ import java.util.stream.Stream;
|
||||
|
||||
import org.jspecify.annotations.Nullable;
|
||||
import org.springframework.data.cassandra.core.query.Query;
|
||||
import org.springframework.lang.Contract;
|
||||
import org.springframework.util.Assert;
|
||||
|
||||
import com.datastax.oss.driver.api.core.CqlIdentifier;
|
||||
@@ -83,6 +84,7 @@ public interface ExecutableSelectOperation {
|
||||
* @see #inTable(CqlIdentifier)
|
||||
* @see SelectWithProjection
|
||||
*/
|
||||
@Contract("_ -> new")
|
||||
default SelectWithProjection<T> inTable(String table) {
|
||||
|
||||
Assert.hasText(table, "Table name must not be null or empty");
|
||||
@@ -101,6 +103,7 @@ public interface ExecutableSelectOperation {
|
||||
* @see com.datastax.oss.driver.api.core.CqlIdentifier
|
||||
* @see SelectWithProjection
|
||||
*/
|
||||
@Contract("_ -> new")
|
||||
SelectWithProjection<T> inTable(CqlIdentifier table);
|
||||
|
||||
}
|
||||
@@ -121,6 +124,7 @@ public interface ExecutableSelectOperation {
|
||||
* @throws IllegalArgumentException if resultType is {@literal null}.
|
||||
* @see SelectWithQuery
|
||||
*/
|
||||
@Contract("_ -> new")
|
||||
<R> SelectWithQuery<R> as(Class<R> resultType);
|
||||
|
||||
}
|
||||
@@ -221,6 +225,7 @@ public interface ExecutableSelectOperation {
|
||||
default Stream<T> stream() {
|
||||
return all().stream();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -17,6 +17,7 @@ package org.springframework.data.cassandra.core;
|
||||
|
||||
import org.springframework.data.cassandra.core.query.Query;
|
||||
import org.springframework.data.cassandra.core.query.Update;
|
||||
import org.springframework.lang.Contract;
|
||||
import org.springframework.util.Assert;
|
||||
|
||||
import com.datastax.oss.driver.api.core.CqlIdentifier;
|
||||
@@ -75,6 +76,7 @@ public interface ExecutableUpdateOperation {
|
||||
* @see #inTable(CqlIdentifier)
|
||||
* @see UpdateWithQuery
|
||||
*/
|
||||
@Contract("_ -> new")
|
||||
default UpdateWithQuery inTable(String table) {
|
||||
|
||||
Assert.hasText(table, "Table name must not be null or empty");
|
||||
@@ -93,6 +95,7 @@ public interface ExecutableUpdateOperation {
|
||||
* @see com.datastax.oss.driver.api.core.CqlIdentifier
|
||||
* @see UpdateWithQuery
|
||||
*/
|
||||
@Contract("_ -> new")
|
||||
UpdateWithQuery inTable(CqlIdentifier table);
|
||||
|
||||
}
|
||||
@@ -110,6 +113,7 @@ public interface ExecutableUpdateOperation {
|
||||
* @throws IllegalArgumentException if {@link Query} is {@literal null}.
|
||||
* @see TerminatingUpdate
|
||||
*/
|
||||
@Contract("_ -> new")
|
||||
TerminatingUpdate matching(Query query);
|
||||
|
||||
}
|
||||
|
||||
@@ -24,6 +24,7 @@ import org.reactivestreams.Subscriber;
|
||||
|
||||
import org.springframework.data.cassandra.core.cql.QueryOptions;
|
||||
import org.springframework.data.cassandra.core.cql.WriteOptions;
|
||||
import org.springframework.lang.Contract;
|
||||
import org.springframework.util.Assert;
|
||||
|
||||
import com.datastax.oss.driver.api.core.cql.BatchableStatement;
|
||||
@@ -64,6 +65,7 @@ public interface ReactiveCassandraBatchOperations {
|
||||
* @return {@code this} {@link ReactiveCassandraBatchOperations}.
|
||||
* @throws IllegalStateException if the batch was already executed.
|
||||
*/
|
||||
@Contract("_ -> this")
|
||||
ReactiveCassandraBatchOperations withTimestamp(long timestamp);
|
||||
|
||||
/**
|
||||
@@ -74,6 +76,7 @@ public interface ReactiveCassandraBatchOperations {
|
||||
* @throws IllegalStateException if the batch was already executed.
|
||||
* @since 4.4
|
||||
*/
|
||||
@Contract("_ -> this")
|
||||
ReactiveCassandraBatchOperations withQueryOptions(QueryOptions options);
|
||||
|
||||
/**
|
||||
@@ -84,6 +87,7 @@ public interface ReactiveCassandraBatchOperations {
|
||||
* @throws IllegalStateException if the batch was already executed.
|
||||
* @since 4.4
|
||||
*/
|
||||
@Contract("_ -> this")
|
||||
default ReactiveCassandraBatchOperations addStatement(BatchableStatement<?> statement) {
|
||||
return addStatement(Mono.just(statement));
|
||||
}
|
||||
@@ -96,6 +100,7 @@ public interface ReactiveCassandraBatchOperations {
|
||||
* @throws IllegalStateException if the batch was already executed.
|
||||
* @since 4.4
|
||||
*/
|
||||
@Contract("_ -> this")
|
||||
ReactiveCassandraBatchOperations addStatement(Mono<? extends BatchableStatement<?>> statement);
|
||||
|
||||
/**
|
||||
@@ -106,6 +111,7 @@ public interface ReactiveCassandraBatchOperations {
|
||||
* @throws IllegalStateException if the batch was already executed.
|
||||
* @since 4.4
|
||||
*/
|
||||
@Contract("_ -> this")
|
||||
default ReactiveCassandraBatchOperations addStatements(BatchableStatement<?>... statements) {
|
||||
return addStatements(Flux.fromArray(statements).toIterable());
|
||||
}
|
||||
@@ -118,6 +124,7 @@ public interface ReactiveCassandraBatchOperations {
|
||||
* @throws IllegalStateException if the batch was already executed.
|
||||
* @since 4.4
|
||||
*/
|
||||
@Contract("_ -> this")
|
||||
default ReactiveCassandraBatchOperations addStatements(Iterable<? extends BatchableStatement<?>> statements) {
|
||||
return addStatements(Mono.just(statements));
|
||||
}
|
||||
@@ -130,6 +137,7 @@ public interface ReactiveCassandraBatchOperations {
|
||||
* @throws IllegalStateException if the batch was already executed.
|
||||
* @since 4.4
|
||||
*/
|
||||
@Contract("_ -> this")
|
||||
ReactiveCassandraBatchOperations addStatements(Mono<? extends Iterable<? extends BatchableStatement<?>>> statements);
|
||||
|
||||
/**
|
||||
@@ -141,6 +149,7 @@ public interface ReactiveCassandraBatchOperations {
|
||||
* @throws IllegalStateException if the batch was already executed.
|
||||
* @since 3.2.2
|
||||
*/
|
||||
@Contract("_, _ -> this")
|
||||
default ReactiveCassandraBatchOperations insert(Object entity, WriteOptions options) {
|
||||
|
||||
Assert.notNull(entity, "Entity must not be null");
|
||||
@@ -155,6 +164,7 @@ public interface ReactiveCassandraBatchOperations {
|
||||
* @return {@code this} {@link ReactiveCassandraBatchOperations}.
|
||||
* @throws IllegalStateException if the batch was already executed.
|
||||
*/
|
||||
@Contract("_ -> this")
|
||||
ReactiveCassandraBatchOperations insert(Object... entities);
|
||||
|
||||
/**
|
||||
@@ -164,6 +174,7 @@ public interface ReactiveCassandraBatchOperations {
|
||||
* @return {@code this} {@link ReactiveCassandraBatchOperations}.
|
||||
* @throws IllegalStateException if the batch was already executed.
|
||||
*/
|
||||
@Contract("_ -> this")
|
||||
ReactiveCassandraBatchOperations insert(Iterable<?> entities);
|
||||
|
||||
/**
|
||||
@@ -173,6 +184,7 @@ public interface ReactiveCassandraBatchOperations {
|
||||
* @return {@code this} {@link ReactiveCassandraBatchOperations}.
|
||||
* @throws IllegalStateException if the batch was already executed.
|
||||
*/
|
||||
@Contract("_ -> this")
|
||||
ReactiveCassandraBatchOperations insert(Mono<? extends Iterable<?>> entities);
|
||||
|
||||
/**
|
||||
@@ -184,6 +196,7 @@ public interface ReactiveCassandraBatchOperations {
|
||||
* @throws IllegalStateException if the batch was already executed.
|
||||
* @see InsertOptions
|
||||
*/
|
||||
@Contract("_, _ -> this")
|
||||
ReactiveCassandraBatchOperations insert(Iterable<?> entities, WriteOptions options);
|
||||
|
||||
/**
|
||||
@@ -195,6 +208,7 @@ public interface ReactiveCassandraBatchOperations {
|
||||
* @throws IllegalStateException if the batch was already executed.
|
||||
* @see InsertOptions
|
||||
*/
|
||||
@Contract("_, _ -> this")
|
||||
ReactiveCassandraBatchOperations insert(Mono<? extends Iterable<?>> entities, WriteOptions options);
|
||||
|
||||
/**
|
||||
@@ -206,6 +220,7 @@ public interface ReactiveCassandraBatchOperations {
|
||||
* @throws IllegalStateException if the batch was already executed.
|
||||
* @since 3.2.2
|
||||
*/
|
||||
@Contract("_, _ -> this")
|
||||
default ReactiveCassandraBatchOperations update(Object entity, WriteOptions options) {
|
||||
|
||||
Assert.notNull(entity, "Entity must not be null");
|
||||
@@ -220,6 +235,7 @@ public interface ReactiveCassandraBatchOperations {
|
||||
* @return {@code this} {@link ReactiveCassandraBatchOperations}.
|
||||
* @throws IllegalStateException if the batch was already executed.
|
||||
*/
|
||||
@Contract("_ -> this")
|
||||
ReactiveCassandraBatchOperations update(Object... entities);
|
||||
|
||||
/**
|
||||
@@ -229,6 +245,7 @@ public interface ReactiveCassandraBatchOperations {
|
||||
* @return {@code this} {@link ReactiveCassandraBatchOperations}.
|
||||
* @throws IllegalStateException if the batch was already executed.
|
||||
*/
|
||||
@Contract("_ -> this")
|
||||
ReactiveCassandraBatchOperations update(Iterable<?> entities);
|
||||
|
||||
/**
|
||||
@@ -238,6 +255,7 @@ public interface ReactiveCassandraBatchOperations {
|
||||
* @return {@code this} {@link ReactiveCassandraBatchOperations}.
|
||||
* @throws IllegalStateException if the batch was already executed.
|
||||
*/
|
||||
@Contract("_ -> this")
|
||||
ReactiveCassandraBatchOperations update(Mono<? extends Iterable<?>> entities);
|
||||
|
||||
/**
|
||||
@@ -249,6 +267,7 @@ public interface ReactiveCassandraBatchOperations {
|
||||
* @throws IllegalStateException if the batch was already executed.
|
||||
* @see UpdateOptions
|
||||
*/
|
||||
@Contract("_, _ -> this")
|
||||
ReactiveCassandraBatchOperations update(Iterable<?> entities, WriteOptions options);
|
||||
|
||||
/**
|
||||
@@ -260,6 +279,7 @@ public interface ReactiveCassandraBatchOperations {
|
||||
* @throws IllegalStateException if the batch was already executed.
|
||||
* @see UpdateOptions
|
||||
*/
|
||||
@Contract("_ -> this")
|
||||
ReactiveCassandraBatchOperations update(Mono<? extends Iterable<?>> entities, WriteOptions options);
|
||||
|
||||
/**
|
||||
@@ -271,6 +291,7 @@ public interface ReactiveCassandraBatchOperations {
|
||||
* @throws IllegalStateException if the batch was already executed.
|
||||
* @since 3.2.2
|
||||
*/
|
||||
@Contract("_ -> this")
|
||||
default ReactiveCassandraBatchOperations delete(Object entity, WriteOptions options) {
|
||||
|
||||
Assert.notNull(entity, "Entity must not be null");
|
||||
@@ -285,6 +306,7 @@ public interface ReactiveCassandraBatchOperations {
|
||||
* @return {@code this} {@link ReactiveCassandraBatchOperations}.
|
||||
* @throws IllegalStateException if the batch was already executed.
|
||||
*/
|
||||
@Contract("_ -> this")
|
||||
ReactiveCassandraBatchOperations delete(Object... entities);
|
||||
|
||||
/**
|
||||
@@ -294,6 +316,7 @@ public interface ReactiveCassandraBatchOperations {
|
||||
* @return {@code this} {@link ReactiveCassandraBatchOperations}.
|
||||
* @throws IllegalStateException if the batch was already executed.
|
||||
*/
|
||||
@Contract("_ -> this")
|
||||
ReactiveCassandraBatchOperations delete(Iterable<?> entities);
|
||||
|
||||
/**
|
||||
@@ -303,6 +326,7 @@ public interface ReactiveCassandraBatchOperations {
|
||||
* @return {@code this} {@link ReactiveCassandraBatchOperations}.
|
||||
* @throws IllegalStateException if the batch was already executed.
|
||||
*/
|
||||
@Contract("_ -> this")
|
||||
ReactiveCassandraBatchOperations delete(Mono<? extends Iterable<?>> entities);
|
||||
|
||||
/**
|
||||
@@ -315,6 +339,7 @@ public interface ReactiveCassandraBatchOperations {
|
||||
* @since 2.2
|
||||
* @see DeleteOptions
|
||||
*/
|
||||
@Contract("_, _ -> this")
|
||||
ReactiveCassandraBatchOperations delete(Iterable<?> entities, WriteOptions options);
|
||||
|
||||
/**
|
||||
@@ -327,5 +352,7 @@ public interface ReactiveCassandraBatchOperations {
|
||||
* @since 2.2
|
||||
* @see DeleteOptions
|
||||
*/
|
||||
@Contract("_, _ -> this")
|
||||
ReactiveCassandraBatchOperations delete(Mono<? extends Iterable<?>> entities, WriteOptions options);
|
||||
|
||||
}
|
||||
|
||||
@@ -18,6 +18,7 @@ package org.springframework.data.cassandra.core;
|
||||
import reactor.core.publisher.Mono;
|
||||
|
||||
import org.springframework.data.cassandra.core.query.Query;
|
||||
import org.springframework.lang.Contract;
|
||||
import org.springframework.util.Assert;
|
||||
|
||||
import com.datastax.oss.driver.api.core.CqlIdentifier;
|
||||
@@ -73,6 +74,7 @@ public interface ReactiveDeleteOperation {
|
||||
* @see #inTable(CqlIdentifier)
|
||||
* @see DeleteWithQuery
|
||||
*/
|
||||
@Contract("_ -> new")
|
||||
default DeleteWithQuery inTable(String table) {
|
||||
|
||||
Assert.hasText(table, "Table name must not be null or empty");
|
||||
@@ -91,7 +93,9 @@ public interface ReactiveDeleteOperation {
|
||||
* @see com.datastax.oss.driver.api.core.CqlIdentifier
|
||||
* @see DeleteWithQuery
|
||||
*/
|
||||
@Contract("_ -> new")
|
||||
DeleteWithQuery inTable(CqlIdentifier table);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -107,6 +111,7 @@ public interface ReactiveDeleteOperation {
|
||||
* @throws IllegalArgumentException if {@link Query} is {@literal null}.
|
||||
* @see TerminatingDelete
|
||||
*/
|
||||
@Contract("_ -> new")
|
||||
TerminatingDelete matching(Query query);
|
||||
|
||||
}
|
||||
|
||||
@@ -17,6 +17,7 @@ package org.springframework.data.cassandra.core;
|
||||
|
||||
import reactor.core.publisher.Mono;
|
||||
|
||||
import org.springframework.lang.Contract;
|
||||
import org.springframework.util.Assert;
|
||||
|
||||
import com.datastax.oss.driver.api.core.CqlIdentifier;
|
||||
@@ -70,6 +71,7 @@ public interface ReactiveInsertOperation {
|
||||
* @see #inTable(CqlIdentifier)
|
||||
* @see InsertWithOptions
|
||||
*/
|
||||
@Contract("_ -> new")
|
||||
default InsertWithOptions<T> inTable(String table) {
|
||||
|
||||
Assert.hasText(table, "Table must not be null or empty");
|
||||
@@ -88,6 +90,7 @@ public interface ReactiveInsertOperation {
|
||||
* @see com.datastax.oss.driver.api.core.CqlIdentifier
|
||||
* @see InsertWithOptions
|
||||
*/
|
||||
@Contract("_ -> new")
|
||||
InsertWithOptions<T> inTable(CqlIdentifier table);
|
||||
|
||||
}
|
||||
@@ -106,6 +109,7 @@ public interface ReactiveInsertOperation {
|
||||
* @see org.springframework.data.cassandra.core.InsertOptions
|
||||
* @see TerminatingInsert
|
||||
*/
|
||||
@Contract("_ -> new")
|
||||
TerminatingInsert<T> withOptions(InsertOptions insertOptions);
|
||||
|
||||
}
|
||||
|
||||
@@ -19,6 +19,7 @@ import reactor.core.publisher.Flux;
|
||||
import reactor.core.publisher.Mono;
|
||||
|
||||
import org.springframework.data.cassandra.core.query.Query;
|
||||
import org.springframework.lang.Contract;
|
||||
import org.springframework.util.Assert;
|
||||
|
||||
import com.datastax.oss.driver.api.core.CqlIdentifier;
|
||||
@@ -80,6 +81,7 @@ public interface ReactiveSelectOperation {
|
||||
* @see #inTable(CqlIdentifier)
|
||||
* @see SelectWithProjection
|
||||
*/
|
||||
@Contract("_ -> new")
|
||||
default SelectWithProjection<T> inTable(String table) {
|
||||
|
||||
Assert.hasText(table, "Table name must not be null or empty");
|
||||
@@ -98,6 +100,7 @@ public interface ReactiveSelectOperation {
|
||||
* @see com.datastax.oss.driver.api.core.CqlIdentifier
|
||||
* @see SelectWithProjection
|
||||
*/
|
||||
@Contract("_ -> new")
|
||||
SelectWithProjection<T> inTable(CqlIdentifier table);
|
||||
|
||||
}
|
||||
@@ -118,6 +121,7 @@ public interface ReactiveSelectOperation {
|
||||
* @throws IllegalArgumentException if {@link Class resultType} is {@literal null}.
|
||||
* @see SelectWithQuery
|
||||
*/
|
||||
@Contract("_ -> new")
|
||||
<R> SelectWithQuery<R> as(Class<R> resultType);
|
||||
|
||||
}
|
||||
@@ -136,6 +140,7 @@ public interface ReactiveSelectOperation {
|
||||
* @see org.springframework.data.cassandra.core.query.Query
|
||||
* @see TerminatingSelect
|
||||
*/
|
||||
@Contract("_ -> new")
|
||||
TerminatingSelect<T> matching(Query query);
|
||||
|
||||
}
|
||||
|
||||
@@ -19,6 +19,7 @@ import reactor.core.publisher.Mono;
|
||||
|
||||
import org.springframework.data.cassandra.core.query.Query;
|
||||
import org.springframework.data.cassandra.core.query.Update;
|
||||
import org.springframework.lang.Contract;
|
||||
import org.springframework.util.Assert;
|
||||
|
||||
import com.datastax.oss.driver.api.core.CqlIdentifier;
|
||||
@@ -78,6 +79,7 @@ public interface ReactiveUpdateOperation {
|
||||
* @see #inTable(CqlIdentifier)
|
||||
* @see UpdateWithQuery
|
||||
*/
|
||||
@Contract("_ -> new")
|
||||
default UpdateWithQuery inTable(String table) {
|
||||
|
||||
Assert.hasText(table, "Table name must not be null or empty");
|
||||
@@ -96,6 +98,7 @@ public interface ReactiveUpdateOperation {
|
||||
* @see com.datastax.oss.driver.api.core.CqlIdentifier
|
||||
* @see UpdateWithQuery
|
||||
*/
|
||||
@Contract("_ -> new")
|
||||
UpdateWithQuery inTable(CqlIdentifier table);
|
||||
|
||||
}
|
||||
@@ -114,6 +117,7 @@ public interface ReactiveUpdateOperation {
|
||||
* @see org.springframework.data.cassandra.core.query.Query
|
||||
* @see TerminatingUpdate
|
||||
*/
|
||||
@Contract("_ -> new")
|
||||
TerminatingUpdate matching(Query query);
|
||||
|
||||
}
|
||||
|
||||
@@ -28,6 +28,9 @@ import java.util.function.UnaryOperator;
|
||||
|
||||
import org.jspecify.annotations.NonNull;
|
||||
import org.jspecify.annotations.Nullable;
|
||||
|
||||
import org.springframework.lang.CheckReturnValue;
|
||||
import org.springframework.lang.Contract;
|
||||
import org.springframework.util.Assert;
|
||||
|
||||
import com.datastax.oss.driver.api.core.cql.SimpleStatement;
|
||||
@@ -135,6 +138,7 @@ public class StatementBuilder<S extends BuildableQuery> {
|
||||
* @param action the bind function to be applied to the statement.
|
||||
* @return {@code this} {@link StatementBuilder}.
|
||||
*/
|
||||
@Contract("_ -> this")
|
||||
public StatementBuilder<S> bind(BindFunction<S> action) {
|
||||
|
||||
Assert.notNull(action, "BindFunction must not be null");
|
||||
@@ -151,6 +155,7 @@ public class StatementBuilder<S extends BuildableQuery> {
|
||||
* @return {@code this} {@link StatementBuilder}.
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
@Contract("_ -> this")
|
||||
public <R extends BuildableQuery> StatementBuilder<S> apply(Function<S, R> action) {
|
||||
|
||||
Assert.notNull(action, "BindFunction must not be null");
|
||||
@@ -168,6 +173,7 @@ public class StatementBuilder<S extends BuildableQuery> {
|
||||
* @param action the {@link Consumer} function that gets notified on {@link #build()}.
|
||||
* @return {@code this} {@link StatementBuilder}.
|
||||
*/
|
||||
@Contract("_ -> this")
|
||||
public StatementBuilder<S> onBuild(Consumer<SimpleStatementBuilder> action) {
|
||||
|
||||
Assert.notNull(action, "Consumer must not be null");
|
||||
@@ -185,6 +191,7 @@ public class StatementBuilder<S extends BuildableQuery> {
|
||||
* @param mappingFunction the {@link UnaryOperator} function that gets notified on {@link #build()}.
|
||||
* @return {@code this} {@link StatementBuilder}.
|
||||
*/
|
||||
@Contract("_ -> this")
|
||||
public StatementBuilder<S> transform(UnaryOperator<SimpleStatement> mappingFunction) {
|
||||
|
||||
Assert.notNull(mappingFunction, "Mapping function must not be null");
|
||||
@@ -200,6 +207,7 @@ public class StatementBuilder<S extends BuildableQuery> {
|
||||
*
|
||||
* @return the built {@link SimpleStatement}.
|
||||
*/
|
||||
@CheckReturnValue
|
||||
public SimpleStatement build() {
|
||||
return build(ParameterHandling.BY_INDEX, this.registry);
|
||||
}
|
||||
@@ -211,6 +219,7 @@ public class StatementBuilder<S extends BuildableQuery> {
|
||||
* @param parameterHandling {@link ParameterHandling} used to determine how to render parameters.
|
||||
* @return the built {@link SimpleStatement}.
|
||||
*/
|
||||
@CheckReturnValue
|
||||
public SimpleStatement build(ParameterHandling parameterHandling) {
|
||||
return build(parameterHandling, this.registry);
|
||||
}
|
||||
@@ -223,6 +232,7 @@ public class StatementBuilder<S extends BuildableQuery> {
|
||||
* @param codecRegistry registry of Apache Cassandra codecs for converting to/from Java types and CQL types.
|
||||
* @return the built {@link SimpleStatement}.
|
||||
*/
|
||||
@CheckReturnValue
|
||||
public SimpleStatement build(ParameterHandling parameterHandling, CodecRegistry codecRegistry) {
|
||||
|
||||
Assert.notNull(parameterHandling, "ParameterHandling must not be null");
|
||||
@@ -383,6 +393,7 @@ public class StatementBuilder<S extends BuildableQuery> {
|
||||
* @return the modified statement instance.
|
||||
*/
|
||||
S bind(S statement, TermFactory factory);
|
||||
|
||||
}
|
||||
|
||||
@FunctionalInterface
|
||||
@@ -409,6 +420,7 @@ public class StatementBuilder<S extends BuildableQuery> {
|
||||
* Named bind markers.
|
||||
*/
|
||||
BY_NAME
|
||||
|
||||
}
|
||||
|
||||
static class ListTerm implements Term {
|
||||
@@ -439,6 +451,7 @@ public class StatementBuilder<S extends BuildableQuery> {
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
static class SetTerm implements Term {
|
||||
@@ -469,6 +482,7 @@ public class StatementBuilder<S extends BuildableQuery> {
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
static class MapTerm implements Term {
|
||||
@@ -518,5 +532,7 @@ public class StatementBuilder<S extends BuildableQuery> {
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -23,6 +23,8 @@ import org.springframework.data.domain.PageRequest;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
import org.springframework.data.domain.Sort;
|
||||
import org.springframework.data.domain.Sort.Direction;
|
||||
import org.springframework.lang.CheckReturnValue;
|
||||
import org.springframework.lang.Contract;
|
||||
import org.springframework.util.Assert;
|
||||
|
||||
/**
|
||||
@@ -215,6 +217,8 @@ public class CassandraPageRequest extends PageRequest {
|
||||
* @return a new {@link CassandraPageRequest} associated with the given {@link Sort}.
|
||||
* @since 2.1.13
|
||||
*/
|
||||
@Contract("_ -> new")
|
||||
@CheckReturnValue
|
||||
public CassandraPageRequest withSort(Sort sort) {
|
||||
|
||||
Assert.notNull(sort, "Sort must not be null");
|
||||
|
||||
Reference in New Issue
Block a user