ignite-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Pavel Tupitsyn <ptupit...@gridgain.com>
Subject Re: BinaryObject Restrictions
Date Fri, 01 Jul 2016 10:16:02 GMT
> same field names on different levels of a class hierarchy
Class hierarchy here is about inheritance.
So if Person inherited Address, then you'd have a problem.
Nesting objects is fine: their fields are written separately.

Pavel.

On Fri, Jul 1, 2016 at 12:42 PM, pragmaticbigdata <amits.84@gmail.com>
wrote:

> From the documentation I understood that BinaryMarshaller is the default
> Marshaller used for serializing and storing objects in the cache. So, all
> the java pojo objects added to the cache are converted to the binary format
> (which is repesented by the BinaryObject class) and deserialized whenever
> we
> retrieve them. Let me know if my understanding is right.
>
> Assuming this, I didn't follow why doesn't the BinaryObject Restriction
> specified on  this page
> <https://apacheignite.readme.io/docs/binary-marshaller>   does not apply
> for
> java pojo's
>
> "BinaryObject format does not allow same field names on different levels of
> a class hierarchy."
>
> public class Person {
>     private String name;
>     private Address address;
> }
>
> public class Address {
>     private String name;
> }
>
> Shouldn't adding a Person object to the cache fail since it has an embedded
> object that also contains the same field with the same type (String name)?
>
> Thanks.
>
>
>
>
>
> --
> View this message in context:
> http://apache-ignite-users.70518.x6.nabble.com/BinaryObject-Restrictions-tp6039.html
> Sent from the Apache Ignite Users mailing list archive at Nabble.com.
>

Mime
View raw message