#64 - Polishing.
Fixed typos, formatting and minor errors in documentation. Original pull request: #106.
This commit is contained in:
committed by
Oliver Drotbohm
parent
774d2e8b09
commit
361d801b14
@@ -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`)
|
||||
|
||||
@@ -192,10 +192,10 @@ Mono<Void> 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<T>)` 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<String, Object>`.
|
||||
|
||||
@@ -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<Integer> 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.
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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<? extends Object> 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<? extends Object> 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) {
|
||||
|
||||
@@ -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);
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user