是否可以使用不是字符串的字段作为@RiakKey
?这是我所拥有的:
public class DomainObject {
@RiakKey private UUID objectId;
}
不幸的是,当前的 (v1.4.0) java 客户端在反序列化上设置了密钥:
java.lang.IllegalArgumentException: Can not set java.util.UUID field com.company.DomainObject.objectId to java.lang.String
at sun.reflect.UnsafeFieldAccessorImpl.throwSetIllegalArgumentException(UnsafeFieldAccessorImpl.java:164) ~[na:1.7.0_25]
at sun.reflect.UnsafeFieldAccessorImpl.throwSetIllegalArgumentException(UnsafeFieldAccessorImpl.java:168) ~[na:1.7.0_25]
at sun.reflect.UnsafeObjectFieldAccessorImpl.set(UnsafeObjectFieldAccessorImpl.java:81) ~[na:1.7.0_25]
at java.lang.reflect.Field.set(Field.java:741) ~[na:1.7.0_25]
at com.basho.riak.client.convert.reflect.ClassUtil.setFieldValue(ClassUtil.java:45) ~[riak-client-1.4.0.jar:na]
at com.basho.riak.client.convert.reflect.AnnotationInfo.setRiakKey(AnnotationInfo.java:149) ~[riak-client-1.4.0.jar:na]
...snip
有没有办法通过将 UUID 更改为字符串来在不降低域对象的情况下做到这一点?