ignite-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From styriver <Scott_Tyri...@mgic.com>
Subject Re: Byte[] serialization
Date Thu, 15 Sep 2016 14:55:56 GMT
I implemented the Binarylizable interface. If I attempt to get the object
from cache using just the key it works. If I attempt to get the object via a
sqlQuery I get the index out of bounds exception. Our preferred approach is
to use SqlQuery. Is there a way to accomplish this? These are the fields

   private UUID id;

   /** Will be indexed in ascending order. */
   @QuerySqlField(index = true)
   private String documentId;

   /** Will be indexed in ascending order. */
   @QuerySqlField(index = true)
   private Integer pageNumber;

   private String pageFormat;
   private byte[] image;

   @Override
   public void readBinary (BinaryReader reader)
      throws BinaryObjectException
   {
      // TODO Auto-generated method stub
      image = reader.readByteArray("image");
      id = reader.readUuid("id");
      pageFormat = reader.readString("pageFormat");
      documentId = reader.readString("documentId");
      pageNumber = reader.readInt("pageNumber");
   }

   @Override
   public void writeBinary (BinaryWriter writer)
      throws BinaryObjectException
   {
      // TODO Auto-generated method stub
      writer.writeByteArray("image", image);
      writer.writeUuid("id", id);
      writer.writeString("pageFormat", pageFormat);
      writer.writeString("documentId", documentId);
      writer.writeInt("pageNumber", pageNumber);
   }




--
View this message in context: http://apache-ignite-users.70518.x6.nabble.com/Byte-serialization-tp7768p7771.html
Sent from the Apache Ignite Users mailing list archive at Nabble.com.

Mime
View raw message