Skip to content
This repository has been archived by the owner on Jan 19, 2022. It is now read-only.

Commit

Permalink
fix failing tests
Browse files Browse the repository at this point in the history
  • Loading branch information
graemerocher committed Mar 4, 2013
1 parent dfe4764 commit 4286f44
Showing 1 changed file with 10 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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) {
Expand Down

0 comments on commit 4286f44

Please sign in to comment.