14
14
import org .apache .commons .logging .LogFactory ;
15
15
import org .springframework .beans .PropertyAccessor ;
16
16
import org .springframework .beans .PropertyAccessorFactory ;
17
- import org .springframework .beans .factory .annotation .Autowired ;
18
17
import org .springframework .data .annotation .CreatedDate ;
19
18
import org .springframework .data .annotation .LastModifiedDate ;
20
19
import org .springframework .data .redis .core .RedisCallback ;
29
28
import org .springframework .util .StringUtils ;
30
29
31
30
import com .google .gson .Gson ;
31
+ import com .google .gson .GsonBuilder ;
32
32
import com .redis .om .spring .convert .RedisOMCustomConversions ;
33
33
import com .redis .om .spring .ops .RedisModulesOperations ;
34
34
import com .redis .om .spring .ops .json .JSONOperations ;
@@ -48,8 +48,6 @@ public class RedisJSONKeyValueAdapter extends RedisKeyValueAdapter {
48
48
private @ Nullable String keyspaceNotificationsConfigParameter = null ;
49
49
private RedisModulesOperations <String > modulesOperations ;
50
50
private RediSearchIndexer indexer ;
51
-
52
- @ Autowired
53
51
private Gson gson ;
54
52
55
53
/**
@@ -63,13 +61,14 @@ public class RedisJSONKeyValueAdapter extends RedisKeyValueAdapter {
63
61
*/
64
62
@ SuppressWarnings ("unchecked" )
65
63
public RedisJSONKeyValueAdapter (RedisOperations <?, ?> redisOps , RedisModulesOperations <?> rmo ,
66
- RedisMappingContext mappingContext , RediSearchIndexer keyspaceToIndexMap ) {
64
+ RedisMappingContext mappingContext , RediSearchIndexer keyspaceToIndexMap , GsonBuilder gsonBuilder ) {
67
65
super (redisOps , mappingContext , new RedisOMCustomConversions ());
68
66
this .modulesOperations = (RedisModulesOperations <String >) rmo ;
69
67
this .redisJSONOperations = modulesOperations .opsForJSON ();
70
68
this .redisOperations = redisOps ;
71
69
this .mappingContext = mappingContext ;
72
70
this .indexer = keyspaceToIndexMap ;
71
+ this .gson = gsonBuilder .create ();
73
72
}
74
73
75
74
/*
0 commit comments