Permalink
Browse files

fix failing tests

  • Loading branch information...
graemerocher committed Mar 4, 2013
1 parent dfe4764 commit 4286f442519aa498ef31a9e24e053e08524b9fa5
@@ -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) {

0 comments on commit 4286f44

Please sign in to comment.