@@ -65,15 +65,7 @@ public Statement bind(Connection connection) {
65
65
66
66
Statement statement = connection .createStatement (operation .toQuery ());
67
67
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 );
77
69
bindByIndex (statement , byIndex );
78
70
79
71
return statement ;
@@ -84,14 +76,15 @@ public String toQuery() {
84
76
return operation .toQuery ();
85
77
}
86
78
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 ) {
88
81
89
82
byName .forEach ((name , o ) -> {
90
83
91
84
if (o .getValue () != null ) {
92
- statement .bind (name , o .getValue ());
85
+ operation .bind (statement , name , o .getValue ());
93
86
} else {
94
- statement .bindNull (name , o .getType ());
87
+ operation .bindNull (statement , name , o .getType ());
95
88
}
96
89
});
97
90
}
0 commit comments