Hi,

Nope, it doesn’t work like that.
Names of fields in the Java class are always the same as the names of the 
fields in BinaryObject.

Frankly, I don’t really see a strong use case for the customization you’re 
asking for.
If it is just to support different naming conventions in different places 
(Java, SQL, other clients)
then I’d much more preferred the simplicity to flexibility and forced a single 
naming across all context. 

Stan

From: DanieleBosetti
Sent: 11 октября 2018 г. 12:31
To: [email protected]
Subject: Using annotations to remap fields when deserializing BinaryObjects

Hi,

is it possible to deserialize cache entries to Java objects, and specify
field names mapping using annotations?

In example, let's say cache entries follow a "with-dashes" naming
convention:

binaryObject.toString() = "domain.User[id=... idHash=... user-name=Paul ]"

And I deserialize it with 

User user = binaryObject.deserialize();

class User {
  *@MapToFieldName{"user-name"}*
  private String name;
}


What can we put in place of "MapToFieldName" so that the "user-name" value
from the binary object is placed into the "name" field?

(I know the @QuerySqlField annotation, but that maps sql field names to
cache field names)


thanks!





--
Sent from: http://apache-ignite-users.70518.x6.nabble.com/

Reply via email to