@@ -99,6 +99,7 @@ static class AutoCloseableQueryRunnerHandler implements InvocationHandler {
99
99
this .target = target ;
100
100
}
101
101
102
+ @ Nullable
102
103
@ Override
103
104
public Object invoke (Object proxy , Method method , Object [] args ) throws Throwable {
104
105
@@ -143,7 +144,7 @@ public DatabaseSelectionProvider getDatabaseSelectionProvider() {
143
144
* Basically a holder of a cypher template supplier and a set of named parameters. It's main purpose is to orchestrate
144
145
* the running of things with a bit of logging.
145
146
*/
146
- class RunnableStatement {
147
+ static class RunnableStatement {
147
148
148
149
RunnableStatement (Supplier <String > cypherSupplier ) {
149
150
this (cypherSupplier , new NamedParameters ());
@@ -179,7 +180,7 @@ protected final Result runWith(AutoCloseableQueryRunner statementRunner) {
179
180
*
180
181
* @param ex the exception to translate
181
182
* @param exceptionTranslator the {@link PersistenceExceptionTranslator} to be used for translation
182
- * @return
183
+ * @return Any translated exception
183
184
*/
184
185
private static RuntimeException potentiallyConvertRuntimeException (RuntimeException ex ,
185
186
PersistenceExceptionTranslator exceptionTranslator ) {
@@ -189,12 +190,12 @@ private static RuntimeException potentiallyConvertRuntimeException(RuntimeExcept
189
190
190
191
class DefaultRunnableSpec implements RunnableSpec {
191
192
192
- private RunnableStatement runnableStatement ;
193
+ private final RunnableStatement runnableStatement ;
193
194
194
195
private String targetDatabase ;
195
196
196
197
DefaultRunnableSpec (Supplier <String > cypherSupplier ) {
197
- this .targetDatabase = Neo4jClient .verifyDatabaseName (resolveTargetDatabaseName (targetDatabase ));
198
+ this .targetDatabase = Neo4jClient .verifyDatabaseName (resolveTargetDatabaseName (null ));
198
199
this .runnableStatement = new RunnableStatement (cypherSupplier );
199
200
}
200
201
@@ -230,8 +231,8 @@ public RunnableSpecTightToDatabase with(Function<T, Map<String, Object>> binder)
230
231
}
231
232
232
233
@ Override
233
- public OngoingBindSpec <? , RunnableSpecTightToDatabase > bind (@ Nullable Object value ) {
234
- return new DefaultOngoingBindSpec (value );
234
+ public < T > OngoingBindSpec <T , RunnableSpecTightToDatabase > bind (T value ) {
235
+ return new DefaultOngoingBindSpec <> (value );
235
236
}
236
237
237
238
@ Override
@@ -243,8 +244,8 @@ public RunnableSpecTightToDatabase bindAll(Map<String, Object> newParameters) {
243
244
@ Override
244
245
public <T > MappingSpec <T > fetchAs (Class <T > targetClass ) {
245
246
246
- return new DefaultRecordFetchSpec (this .targetDatabase , this .runnableStatement ,
247
- new SingleValueMappingFunction (conversionService , targetClass ));
247
+ return new DefaultRecordFetchSpec <> (this .targetDatabase , this .runnableStatement ,
248
+ new SingleValueMappingFunction <> (conversionService , targetClass ));
248
249
}
249
250
250
251
@ Override
@@ -368,7 +369,7 @@ class DefaultRunnableDelegation<T> implements RunnableDelegation<T>, OngoingDele
368
369
}
369
370
370
371
@ Override
371
- public RunnableDelegation in (@ Nullable @ SuppressWarnings ("HiddenField" ) String targetDatabase ) {
372
+ public RunnableDelegation < T > in (@ Nullable @ SuppressWarnings ("HiddenField" ) String targetDatabase ) {
372
373
373
374
this .targetDatabase = Neo4jClient .verifyDatabaseName (targetDatabase );
374
375
return this ;
0 commit comments