62
62
final class DefaultNeo4jClient implements Neo4jClient {
63
63
64
64
private final Driver driver ;
65
- private final TypeSystem typeSystem ;
66
65
private @ Nullable final DatabaseSelectionProvider databaseSelectionProvider ;
67
66
private @ Nullable final UserSelectionProvider userSelectionProvider ;
68
67
private final ConversionService conversionService ;
@@ -75,7 +74,6 @@ final class DefaultNeo4jClient implements Neo4jClient {
75
74
DefaultNeo4jClient (Builder builder ) {
76
75
77
76
this .driver = builder .driver ;
78
- this .typeSystem = driver .defaultTypeSystem ();
79
77
this .databaseSelectionProvider = builder .databaseSelectionProvider ;
80
78
this .userSelectionProvider = builder .userSelectionProvider ;
81
79
@@ -452,7 +450,7 @@ public Optional<T> one() {
452
450
try (QueryRunner statementRunner = getQueryRunner (this .databaseSelection , this .impersonatedUser )) {
453
451
Result result = runnableStatement .runWith (statementRunner );
454
452
Optional <T > optionalValue = result .hasNext () ?
455
- Optional .ofNullable (mappingFunction .apply (typeSystem , result .single ())) :
453
+ Optional .ofNullable (mappingFunction .apply (TypeSystem . getDefault () , result .single ())) :
456
454
Optional .empty ();
457
455
ResultSummaries .process (result .consume ());
458
456
return optionalValue ;
@@ -468,7 +466,7 @@ public Optional<T> first() {
468
466
469
467
try (QueryRunner statementRunner = getQueryRunner (this .databaseSelection , this .impersonatedUser )) {
470
468
Result result = runnableStatement .runWith (statementRunner );
471
- Optional <T > optionalValue = result .stream ().map (partialMappingFunction (typeSystem )).filter (Objects ::nonNull ).findFirst ();
469
+ Optional <T > optionalValue = result .stream ().map (partialMappingFunction (TypeSystem . getDefault () )).filter (Objects ::nonNull ).findFirst ();
472
470
ResultSummaries .process (result .consume ());
473
471
return optionalValue ;
474
472
} catch (RuntimeException e ) {
@@ -483,7 +481,7 @@ public Collection<T> all() {
483
481
484
482
try (QueryRunner statementRunner = getQueryRunner (this .databaseSelection , this .impersonatedUser )) {
485
483
Result result = runnableStatement .runWith (statementRunner );
486
- Collection <T > values = result .stream ().map (partialMappingFunction (typeSystem )).filter (Objects ::nonNull ).collect (Collectors .toList ());
484
+ Collection <T > values = result .stream ().map (partialMappingFunction (TypeSystem . getDefault () )).filter (Objects ::nonNull ).collect (Collectors .toList ());
487
485
ResultSummaries .process (result .consume ());
488
486
return values ;
489
487
} catch (RuntimeException e ) {
0 commit comments