Your welcome, there is even another annotation to exclude default values which also excludes null values (boolean=false, int=0, etc)

Those are well explained at fasterxml.com website, check their wiki since you might find more interesting behaviour on the Jackson object mapper.

Guido.

On 17/12/12 09:52, Ingo Rockel wrote:
Hi Guido,

thanks, that's what I was looking for and I was looking at the wrong place.

Ingo

Am 14.12.2012 20:16, schrieb Guido Medina:
Thats more related to Jackson object mapper, annotate your POJO like this:

@JsonSerialize(include=JsonSerialize.Inclusion.NON_NULL)
public class MyPOJO{
...
...
}

Hope that helps,

Guido.

On 14/12/12 17:16, Ingo Rockel wrote:
Hi all,

Is there a way to tell the riak-java-client to not store attributes
with a null value into riak? I currently have a json object looking
like this:

{"status":1,
"type":8,
"content":"some text",
"receiver":17542,
"sender":317825,
"creationTime":1290565802000,
"answered":false,
"contentPath":null,
"refValue":null,
"countOrAmountValue":null,
"subType":0}

which is derived from a POJO with these attributes. Note three values
are "null" and I would like to not store them into riak to save space.

Anyone?


Ingo

_______________________________________________
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




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

Reply via email to