File tree Expand file tree Collapse file tree 1 file changed +7
-3
lines changed
redis-driver/src/main/java/org/jnosql/diana/redis/key Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -31,8 +31,12 @@ class RedisSet<T> extends RedisCollection<T> implements Set<T> {
3131 @ Override
3232 public boolean add (T e ) {
3333 Objects .requireNonNull (e );
34- jedis .sadd (keyWithNameSpace , JSONB .toJson (e ));
35- return false ;
34+ if (isString ) {
35+ jedis .sadd (keyWithNameSpace , e .toString ());
36+ } else {
37+ jedis .sadd (keyWithNameSpace , JSONB .toJson (e ));
38+ }
39+ return true ;
3640 }
3741
3842 @ Override
@@ -92,7 +96,7 @@ protected List<T> toArrayList() {
9296 Set <String > redisValues = jedis .smembers (keyWithNameSpace );
9397 List <T > list = new ArrayList <>();
9498 for (String redisValue : redisValues ) {
95- if (isString ) {
99+ if (isString ) {
96100 list .add ((T ) redisValue );
97101 } else {
98102 list .add (JSONB .fromJson (redisValue , clazz ));
You can’t perform that action at this time.
0 commit comments