diff --git a/src/main/asciidoc/reference/r2dbc-core.adoc b/src/main/asciidoc/reference/r2dbc-core.adoc index aba9b62..87466e3 100644 --- a/src/main/asciidoc/reference/r2dbc-core.adoc +++ b/src/main/asciidoc/reference/r2dbc-core.adoc @@ -229,7 +229,7 @@ This approach lets you use the standard `io.r2dbc.spi.ConnectionFactory` instanc Spring Data R2DBC supports drivers by R2DBC's pluggable SPI mechanism. Any driver implementing the R2DBC spec can be used with Spring Data R2DBC. R2DBC is a relatively young initiative that gains significance by maturing through adoption. -As of writing the following 3 drivers are available: +As of writing the following drivers are available: * https://github.com/r2dbc/r2dbc-postgresql[Postgres] (`io.r2dbc:r2dbc-postgresql`) * https://github.com/r2dbc/r2dbc-h2[H2] (`io.r2dbc:r2dbc-h2`) diff --git a/src/main/asciidoc/reference/r2dbc-fluent.adoc b/src/main/asciidoc/reference/r2dbc-fluent.adoc index faf9943..7ac0ead 100644 --- a/src/main/asciidoc/reference/r2dbc-fluent.adoc +++ b/src/main/asciidoc/reference/r2dbc-fluent.adoc @@ -192,10 +192,10 @@ Mono update = databaseClient.update() <4> Use `then()` to just update rows an object without consuming further details. Modifying statements allow also consumption of the number of affected rows. ==== -[r2dbc.datbaseclient.fluent-api.delete.methods]] -==== Methods for DELETE operations +[r2dbc.datbaseclient.fluent-api.update.methods]] +==== Methods for UPDATE operations -The `delete()` entry point exposes some additional methods that provide options for the operation: +The `update()` entry point exposes some additional methods that provide options for the operation: * *table* `(Class)` used to specify the target table using a mapped object. Returns results by default as `T`. * *table* `(String)` used to specify the target table name. Returns results by default as `Map`. diff --git a/src/main/asciidoc/reference/r2dbc-sql.adoc b/src/main/asciidoc/reference/r2dbc-sql.adoc index 56bbfe9..eb824d0 100644 --- a/src/main/asciidoc/reference/r2dbc-sql.adoc +++ b/src/main/asciidoc/reference/r2dbc-sql.adoc @@ -2,7 +2,7 @@ = Executing Statements Running a statement is the basic functionality that is covered by `DatabaseClient`. -The following example shows what you need to include for a minimal but fully functional class that creates a new table: +The following example shows what you need to include for minimal but fully functional code that creates a new table: [source,java] ---- @@ -32,7 +32,7 @@ Mono affectedRows = client.execute() .fetch().rowsUpdated(); ---- -Running a `SELECT` query returns a different type of result, in particular tabular results. Tabular data is typically consumes by streaming each `Row`. +Running a `SELECT` query returns a different type of result, in particular tabular results. Tabular data is typically consumed by streaming each `Row`. You might have noticed the use of `fetch()` in the previous example. `fetch()` is a continuation operator that allows you to specify how much data you want to consume. diff --git a/src/main/java/org/springframework/data/r2dbc/dialect/Bindings.java b/src/main/java/org/springframework/data/r2dbc/dialect/Bindings.java index 40242b8..94fb90e 100644 --- a/src/main/java/org/springframework/data/r2dbc/dialect/Bindings.java +++ b/src/main/java/org/springframework/data/r2dbc/dialect/Bindings.java @@ -33,7 +33,7 @@ import org.springframework.lang.Nullable; import org.springframework.util.Assert; /** - * Value object representing value and {@code NULL} bindings for a {@link Statement} using {@link BindMarkers}. Bindings + * Value object representing value and {@code null} bindings for a {@link Statement} using {@link BindMarkers}. Bindings * are typically immutable. * * @author Mark Paluch diff --git a/src/main/java/org/springframework/data/r2dbc/dialect/MutableBindings.java b/src/main/java/org/springframework/data/r2dbc/dialect/MutableBindings.java index c0cb0ce..dd2abda 100644 --- a/src/main/java/org/springframework/data/r2dbc/dialect/MutableBindings.java +++ b/src/main/java/org/springframework/data/r2dbc/dialect/MutableBindings.java @@ -22,7 +22,7 @@ import java.util.LinkedHashMap; import org.springframework.util.Assert; /** - * Mutable extension to {@link Bindings} for Value and {@code NULL} bindings for a {@link Statement} using + * Mutable extension to {@link Bindings} for Value and {@code null} bindings for a {@link Statement} using * {@link BindMarkers}. * * @author Mark Paluch diff --git a/src/main/java/org/springframework/data/r2dbc/function/query/Criteria.java b/src/main/java/org/springframework/data/r2dbc/function/query/Criteria.java index 4e4153f..30fa6a1 100644 --- a/src/main/java/org/springframework/data/r2dbc/function/query/Criteria.java +++ b/src/main/java/org/springframework/data/r2dbc/function/query/Criteria.java @@ -46,6 +46,7 @@ public class Criteria { private Criteria(@Nullable Criteria previous, Combinator combinator, String column, Comparator comparator, @Nullable Object value) { + this.previous = previous; this.combinator = combinator; this.column = column; @@ -56,7 +57,7 @@ public class Criteria { /** * Static factory method to create a Criteria using the provided {@code column} name. * - * @param column + * @param column Must not be {@literal null} or empty. * @return a new {@link CriteriaStep} object to complete the first {@link Criteria}. */ public static CriteriaStep where(String column) { @@ -69,7 +70,7 @@ public class Criteria { /** * Create a new {@link Criteria} and combine it with {@code AND} using the provided {@code column} name. * - * @param column + * @param column Must not be {@literal null} or empty. * @return a new {@link CriteriaStep} object to complete the next {@link Criteria}. */ public CriteriaStep and(String column) { @@ -87,7 +88,7 @@ public class Criteria { /** * Create a new {@link Criteria} and combine it with {@code OR} using the provided {@code column} name. * - * @param column + * @param column Must not be {@literal null} or empty. * @return a new {@link CriteriaStep} object to complete the next {@link Criteria}. */ public CriteriaStep or(String column) { @@ -179,7 +180,7 @@ public class Criteria { /** * Creates a {@link Criteria} using {@code IN}. * - * @param value + * @param values * @return */ Criteria in(Object... values); @@ -187,7 +188,7 @@ public class Criteria { /** * Creates a {@link Criteria} using {@code IN}. * - * @param value + * @param values * @return */ Criteria in(Collection values); @@ -195,7 +196,7 @@ public class Criteria { /** * Creates a {@link Criteria} using {@code NOT IN}. * - * @param value + * @param values * @return */ Criteria notIn(Object... values); @@ -203,7 +204,7 @@ public class Criteria { /** * Creates a {@link Criteria} using {@code NOT IN}. * - * @param value + * @param values * @return */ Criteria notIn(Collection values); @@ -251,7 +252,6 @@ public class Criteria { /** * Creates a {@link Criteria} using {@code IS NULL}. * - * @param value * @return */ Criteria isNull(); @@ -259,7 +259,6 @@ public class Criteria { /** * Creates a {@link Criteria} using {@code IS NOT NULL}. * - * @param value * @return */ Criteria isNotNull(); @@ -314,9 +313,9 @@ public class Criteria { return createCriteria(Comparator.IN, Arrays.asList(values)); } - /** - * @param values - * @return + /* + * (non-Javadoc) + * @see org.springframework.data.r2dbc.function.query.Criteria.CriteriaStep#in(java.util.Collection) */ @Override public Criteria in(Collection values) { @@ -343,9 +342,9 @@ public class Criteria { return createCriteria(Comparator.NOT_IN, Arrays.asList(values)); } - /** - * @param values - * @return + /* + * (non-Javadoc) + * @see org.springframework.data.r2dbc.function.query.Criteria.CriteriaStep#notIn(java.util.Collection) */ @Override public Criteria notIn(Collection values) { diff --git a/src/main/java/org/springframework/data/r2dbc/function/query/QueryMapper.java b/src/main/java/org/springframework/data/r2dbc/function/query/QueryMapper.java index 95b0653..18229f3 100644 --- a/src/main/java/org/springframework/data/r2dbc/function/query/QueryMapper.java +++ b/src/main/java/org/springframework/data/r2dbc/function/query/QueryMapper.java @@ -166,6 +166,7 @@ public class QueryMapper { typeHint = getTypeHint(mappedValue, actualType.getType(), settableValue); } else { + mappedValue = convertValue(criteria.getValue(), propertyField.getTypeHint()); typeHint = actualType.getType(); } @@ -227,6 +228,7 @@ public class QueryMapper { condition = column.in(expressions.toArray(new Expression[0])); } else { + BindMarker bindMarker = bindings.nextMarker(column.getName()); Expression expression = bind(mappedValue, valueType, bindings, bindMarker); diff --git a/src/main/java/org/springframework/data/r2dbc/function/query/UpdateMapper.java b/src/main/java/org/springframework/data/r2dbc/function/query/UpdateMapper.java index 400a131..b28a7ab 100644 --- a/src/main/java/org/springframework/data/r2dbc/function/query/UpdateMapper.java +++ b/src/main/java/org/springframework/data/r2dbc/function/query/UpdateMapper.java @@ -21,6 +21,7 @@ import java.util.Map; import org.springframework.data.r2dbc.dialect.BindMarker; import org.springframework.data.r2dbc.dialect.BindMarkers; +import org.springframework.data.r2dbc.dialect.Bindings; import org.springframework.data.r2dbc.dialect.MutableBindings; import org.springframework.data.r2dbc.domain.SettableValue; import org.springframework.data.r2dbc.function.convert.R2dbcConverter;