Skip to content

Commit 58bd298

Browse files
committed
#73 - hacking - minor code improvements.
1 parent 605e52e commit 58bd298

File tree

1 file changed

+5
-12
lines changed

1 file changed

+5
-12
lines changed

src/main/java/org/springframework/data/r2dbc/function/ParameterbindingPreparedOperation.java

+5-12
Original file line numberDiff line numberDiff line change
@@ -65,15 +65,7 @@ public Statement bind(Connection connection) {
6565

6666
Statement statement = connection.createStatement(operation.toQuery());
6767

68-
byName.forEach((name, o) -> {
69-
70-
if (o.getValue() != null) {
71-
operation.bind(statement, name, o.getValue());
72-
} else {
73-
operation.bindNull(statement, name, o.getType());
74-
}
75-
});
76-
68+
bindByName(statement, byName);
7769
bindByIndex(statement, byIndex);
7870

7971
return statement;
@@ -84,14 +76,15 @@ public String toQuery() {
8476
return operation.toQuery();
8577
}
8678

87-
private static void bindByName(Statement statement, Map<String, SettableValue> byName) {
79+
// todo that is a weird assymmetry between bindByName and bindByIndex
80+
private void bindByName(Statement statement, Map<String, SettableValue> byName) {
8881

8982
byName.forEach((name, o) -> {
9083

9184
if (o.getValue() != null) {
92-
statement.bind(name, o.getValue());
85+
operation.bind(statement,name, o.getValue());
9386
} else {
94-
statement.bindNull(name, o.getType());
87+
operation.bindNull(statement, name, o.getType());
9588
}
9689
});
9790
}

0 commit comments

Comments
 (0)