Hello!
Why do you try to store List in cache? It should work if you
will just put plain BinaryObject's in it without List<>.
Regards,
--
Ilya Kasnacheev
2018-07-18 17:42 GMT+03:00 debashissinha :
> Hi ,
>
> If I add a List to cache and also in the cache configuration
> I
> set QueryEntity with fields, then how can I query using
> cache.query(new SqlFieldQuery("Some sql"));
>
> Sample I am trying to use is
>
> CacheConfiguration> cfg = new
> CacheConfiguration();
> cfg.setQueryEntities(new ArrayList(){{
>
> e.setKeyType("java.lang.Integer");
> e.setValueType("Person");
> e.setFields(new LinkedHashMap(){{
>
> put("id","java.lang.Integer");
> put("name","java.lang.String");
>
> }});
> add(e);
> }});
>
> cfg.setName("TESTPERSON");
>
> Ignite ignite = Ignition.start();
> IgniteCache> cache =
> ignite.getOrCreateCache(cfg).withKeepBinary();
>
> List binaryObjectList = new ArrayList();
> IgniteBinary binary = binary.builder("Person");
>
> bldr.setField("id",1);
> bldr.setField("name","test");
> binaryObjectList.add(bldr.build());
>
> cache.put(1,binaryObjectList);
>
> QueryCursor> cursor = cache.query(new SqlFieldsQuery("Select *
> from Person"));
>
> Am getting empty results here.
> Can some one kindly help .
>
> Thanks in advance.
> Debashis Sinha
>
>
>
> --
> Sent from: http://apache-ignite-users.70518.x6.nabble.com/
>