Hi,

 

Appreciate  some help, to  understand  why is  this  failing  and  how  to correct this.

 

Trying to  read  a  list of  binary  objects form a  composite  data structure

Here  is the  sample code.  As  per  ignite  documentation this  should be  possible.

 

 

@Getter

@Setter

Public class Car implements Serializable {

private String name;

private List<Car> inspirations;

private BigDecimal weight;

}

 

 

@Test

Public void testGetCarInspirationsWith Binaryapi(){

 

Ignite ignite = Ignition.start();

 

Car car = new Car();

car.setName(“carname”);

car.setWeight(BigDecimal.ONE);

car.setInspirations(List.of(new Car(), new Car()));

 

 

ignite.getOrCreateCache(“Sample”).put("carname”, car);

IgniteCache<String, BinaryObject> binaryCarCache = ignite.getOrCreateCache(“Sample”).withKeepBinary();

 

// this  line is not  returning list  of  binary objects, rather  returning desrialize  objects

List<BinaryObject> carInspirations = binaryCache.get(“carname”).field(“inspirations”);

 

}

 

 

Tech

Java 11

Ignite 2.14

 

 

Thanks

D

 

Reply via email to