1414import org .apache .commons .logging .LogFactory ;
1515import org .springframework .beans .PropertyAccessor ;
1616import org .springframework .beans .PropertyAccessorFactory ;
17- import org .springframework .beans .factory .annotation .Autowired ;
1817import org .springframework .data .annotation .CreatedDate ;
1918import org .springframework .data .annotation .LastModifiedDate ;
2019import org .springframework .data .redis .core .RedisCallback ;
2928import org .springframework .util .StringUtils ;
3029
3130import com .google .gson .Gson ;
31+ import com .google .gson .GsonBuilder ;
3232import com .redis .om .spring .convert .RedisOMCustomConversions ;
3333import com .redis .om .spring .ops .RedisModulesOperations ;
3434import com .redis .om .spring .ops .json .JSONOperations ;
@@ -48,8 +48,6 @@ public class RedisJSONKeyValueAdapter extends RedisKeyValueAdapter {
4848 private @ Nullable String keyspaceNotificationsConfigParameter = null ;
4949 private RedisModulesOperations <String > modulesOperations ;
5050 private RediSearchIndexer indexer ;
51-
52- @ Autowired
5351 private Gson gson ;
5452
5553 /**
@@ -63,13 +61,14 @@ public class RedisJSONKeyValueAdapter extends RedisKeyValueAdapter {
6361 */
6462 @ SuppressWarnings ("unchecked" )
6563 public RedisJSONKeyValueAdapter (RedisOperations <?, ?> redisOps , RedisModulesOperations <?> rmo ,
66- RedisMappingContext mappingContext , RediSearchIndexer keyspaceToIndexMap ) {
64+ RedisMappingContext mappingContext , RediSearchIndexer keyspaceToIndexMap , GsonBuilder gsonBuilder ) {
6765 super (redisOps , mappingContext , new RedisOMCustomConversions ());
6866 this .modulesOperations = (RedisModulesOperations <String >) rmo ;
6967 this .redisJSONOperations = modulesOperations .opsForJSON ();
7068 this .redisOperations = redisOps ;
7169 this .mappingContext = mappingContext ;
7270 this .indexer = keyspaceToIndexMap ;
71+ this .gson = gsonBuilder .create ();
7372 }
7473
7574 /*
0 commit comments