@@ -94,46 +94,28 @@ public boolean isIndexed() {
94
94
95
95
public static class NamedExpandedSingleBinding <T > extends SingleBinding <T >{
96
96
97
- public NamedExpandedSingleBinding (T identifier , SettableValue value ) {
98
- super (identifier , value );
99
- }
100
-
101
- @ Override
102
- public void bindTo (Statement statement ) {
103
-
104
- if (getValue ().isEmpty ()) {
105
- statement .bindNull (getIdentifier (), getValue ().getType ());
106
- }
107
-
108
- statement .bind (getIdentifier (), getValue ());
109
- }
110
-
111
- @ Override
112
- public boolean isIndexed () {
113
- return false ;
114
- }
115
- }
97
+ private final BindableOperation operation ;
116
98
117
- public static class IndexedExpandedSingleBinding extends SingleBinding < Integer > {
99
+ public NamedExpandedSingleBinding ( T identifier , SettableValue value , BindableOperation operation ) {
118
100
119
- public IndexedExpandedSingleBinding (Integer identifier , SettableValue value ) {
120
101
super (identifier , value );
102
+
103
+ this .operation = operation ;
121
104
}
122
105
123
106
@ Override
124
107
public void bindTo (Statement statement ) {
125
108
126
- if (getValue ().isEmpty ()) {
127
- statement .bindNull ((int )getIdentifier (), getValue ().getType ());
109
+ if (getValue () != null ) {
110
+ operation .bind (statement ,getIdentifier (), getValue ());
111
+ } else {
112
+ operation .bindNull (statement , getIdentifier (), getValue ().getType ());
128
113
}
129
-
130
- statement .bind ((int )getIdentifier (), getValue ());
131
114
}
115
+
132
116
@ Override
133
117
public boolean isIndexed () {
134
- return true ;
118
+ return false ;
135
119
}
136
120
}
137
-
138
-
139
121
}
0 commit comments