@RiakIndex annotated field is not stored as part of value

Santi Kumar santi at veradocs.com
Tue Jan 27 08:46:14 EST 2015


HI Chris
I cant send the code publicly so I tested with couple more examples.If I
annotate the field with "secretKey" or "authSecret", then those field
values are becoming null in the object.

If I change the key with "indexKey" or some thing then it's part of the
object state. I have modified accordingly. Is there any restrictions on the
naming of the 2i index?

Thanks
Santi

On Mon, Jan 26, 2015 at 10:29 PM, Christopher Meiklejohn <
cmeiklejohn at basho.com> wrote:

>
> On Jan 26, 2015, at 5:48 PM, Santi Kumar <santi at veradocs.com> wrote:
>
> Yes. I'm using POJO and annotating one of the field with RiakIndex. When
> I'm reading the object with the key, as the tag field is not part of the
> object, while writing I dont have the tag value while writing the object.
>
> Class Foo {
>
> private String fooId;
>
> @RiakIndex(name="barid")
>
> private String barid;
>
> .....
>
> }
>
> When I'm storing the object, I set the barid for the object and storing
> the object. Annotation is taking care of tagging the object with barid.
>
> When I query the object with barId, I have the barId value so I'm setting
> barId to object and writing it. But If I lookup the object with fooId, as
> barId value is not part of the object I cant tag the object with barid. SO
> when I'm writing the object I'm losing the association .
>
> So Is there any thing I'm missing to make it part of the object state.
> That way as you said, When I read-modify-write, the tag value exist all the
> time.
>
>
> Hi Santi,
>
> I’m having trouble following your exact issue.  Is it possible for you to
> share the problematic code so we can try to reproduce it here?
>
> Thanks,
> Chris
>
> Christopher Meiklejohn
> Senior Software Engineer
> Basho Technologies, Inc.
> cmeiklejohn at basho.com
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.basho.com/pipermail/riak-users_lists.basho.com/attachments/20150127/a23bee81/attachment-0002.html>


More information about the riak-users mailing list