Hi Ilya

I was going thru an example using BinaryObject and trying to follow the
same. 

I have created a table with the below SQL DDL

CREATE TABLE city_details (
  city_id LONG PRIMARY KEY, city_name VARCHAR, state_name VARCHAR )
  WITH "backups=1, cache_name=city_details, key_type=com.ril.edif.cityKey,
value_type=com.ril.edif.city" ;

Inserted 2 records thru SQL line and was trying query data thru Java API,
here is the code

+--------------------------------+--------------------------------+--------------------------------+
|            CITY_ID             |           CITY_NAME            |          
STATE_NAME           |
+--------------------------------+--------------------------------+--------------------------------+
| 1                              | Mumbai                         | MH          
                  
|
| 2                              | Hyd                            | TS          
                  
|
+--------------------------------+--------------------------------+--------------------------------+


        IgniteCache<Long, BinaryObject> binaryCache =
ignite.cache("city_details").withKeepBinary();
        BinaryObject po = binaryCache.get(new Long(1));
        String name = po.field("city_name");

Does not seems to be working, getting java.lang.NullPointerException at
String name = po.field("city_name")

what is wrong with this code.

As the doc mentioned the reason I am going for binary object is to not to
maintain or write POJOs for all the objects and maintain it under classpath. 

Does the rest API work for GET if we dont keep classes under classpath

Thanks
Naveen



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

Reply via email to