Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

fix failing tests

  • Loading branch information...
commit 4286f442519aa498ef31a9e24e053e08524b9fa5 1 parent dfe4764
@graemerocher graemerocher authored
View
12 grails-datastore-redis/src/main/java/org/grails/datastore/mapping/redis/engine/RedisEntityPersister.java
@@ -46,6 +46,7 @@
import org.springframework.dao.CannotAcquireLockException;
import redis.clients.jedis.exceptions.JedisDataException;
+import redis.clients.util.SafeEncoder;
/**
* An {@link org.grails.datastore.mapping.engine.EntityPersister} for the Redis NoSQL datastore.
@@ -88,8 +89,15 @@ protected void setEntryValue(Map nativeEntry, String key, Object value) {
return;
}
- final ConversionService conversionService = getMappingContext().getConversionService();
- nativeEntry.put(key, conversionService.convert(value, String.class));
+ Class type = value.getClass();
+ if(value != null && type.isArray() && byte.class.isAssignableFrom(type.getComponentType())) {
+ nativeEntry.put(key, SafeEncoder.encode((byte[])value));
+ }
+ else {
+
+ final ConversionService conversionService = getMappingContext().getConversionService();
+ nativeEntry.put(key, conversionService.convert(value, String.class));
+ }
}
private boolean shouldConvert(Object value) {
Please sign in to comment.
Something went wrong with that request. Please try again.