Create a pseudo getters for the 2i indexes, valid return types are:
String, Long (And Integer) and Set of any of the mentioned, the benefit of this is the fact that your 2i indexes are not actual properties, they are meant to be computation of something, example:

/public class Postcode {//

//    @//RiakKey//
//    String postcode//
//    ...//
//    ...//
//
//    @RiakIndex("sector")//
//    @JsonIgnore//
//    public String getSector() {//
//        return postcode.substring(0,postcode.length() - 4//);//
//    }//

//}//
/
In this example we create a 2i index for the sector but don't store it in the Riak JSON.

HTH,

Guido.

On 22/08/13 16:32, mex wrote:
If I declare @RiakKey and 2i indexes (@RiakIndex) for some fields in my
"Item" class, then those fields will not be displayed when querying the
record over the browser (ie. http://localhost/riak/myBucket/myKey1).

I have tried adding the annotation @JSONInclude but does not seem to change
the behaviour. Is there a way around it?

Thanks



--
View this message in context: 
http://riak-users.197444.n3.nabble.com/Including-RiakKey-and-RiakIndexes-in-the-stored-JSON-tp4028933.html
Sent from the Riak Users mailing list archive at Nabble.com.

_______________________________________________
riak-users mailing list
riak-users@lists.basho.com
http://lists.basho.com/mailman/listinfo/riak-users_lists.basho.com

_______________________________________________
riak-users mailing list
riak-users@lists.basho.com
http://lists.basho.com/mailman/listinfo/riak-users_lists.basho.com

Reply via email to