0

I am using Spring data 2.0.5 version with Spring Boot

I am trying to figure out on using GemFire's PDXSerializer how to write or read a HashSet.

writer.writeObjet methods seems not to be working. Please guide!

TuneIt
  • 572
  • 2
  • 9
  • 20

1 Answers1

0

Here is how I was able to achieve the same.

Meanwhile, I am also wondering if there is any annotation way using java reflections to convert all the fields.

Answer is:

@Override
  public void toData(PdxWriter pdxWriter) {
    pdxWriter.writeObject("data", this.data);
  }

  @Override
  public void fromData(PdxReader pdxReader) {
    this.data= (Set<Integer>) pdxReader.readObject("data");
  }
TuneIt
  • 572
  • 2
  • 9
  • 20