mirror of
https://github.com/ebean-orm/ebean.git
synced 2024-04-21 10:51:47 +00:00
Merge pull request #2310 from FOCONIS/nutation-on-cache
FIX: mutation info is not restored on cache hit
This commit is contained in:
@@ -5,6 +5,7 @@ import io.ebean.bean.EntityBean;
|
||||
import io.ebean.bean.EntityBeanIntercept;
|
||||
import io.ebean.bean.MutableValueInfo;
|
||||
import io.ebean.bean.MutableValueNext;
|
||||
import io.ebean.bean.PersistenceContext;
|
||||
import io.ebean.core.type.DataReader;
|
||||
import io.ebean.core.type.ScalarType;
|
||||
import io.ebean.text.TextException;
|
||||
@@ -104,6 +105,18 @@ public class BeanPropertyJsonMapper extends BeanPropertyJsonBasic {
|
||||
throw new PersistenceException("Error readSet on " + descriptor + "." + name, e);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setCacheDataValue(EntityBean bean, Object cacheData, PersistenceContext context) {
|
||||
if (cacheData instanceof String) {
|
||||
// parse back from string to support optimisation of java object serialisation
|
||||
final MutableValueInfo hash = createMutableInfo((String)cacheData);
|
||||
bean._ebean_getIntercept().mutableInfo(propertyIndex, hash);
|
||||
cacheData = scalarType.parse((String) cacheData);
|
||||
}
|
||||
setValue(bean, cacheData);
|
||||
}
|
||||
|
||||
|
||||
private static final class NextPair implements MutableValueNext {
|
||||
|
||||
|
||||
Reference in New Issue
Block a user