ignite-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From xeseo <xe...@163.com>
Subject Re: Using Json object to replace POJO
Date Tue, 13 Oct 2015 03:41:16 GMT
Thanks for reply. 
well, for better understanding, I'll take an example.
Let's say I have a table in database, table A(C1,C2).
What I'm trying to do is reading content from database with the below SQL:
select C1 as empName, C2 as empScore from A
, then mapping the result into a JSON object, e.g.
{"empName":"Edison","empScore":90}, to return.
And JSON string as result is also acceptable, not sure whether [1] is the
same thing.

[1] https://issues.apache.org/jira/browse/IGNITE-962

dsetrakyan wrote
> JSONObject is also just a Java object.

Although JSON Object is also a Java POJO, but I don't think I can use
CacheJdbcPojoStore directly for this purpose.
What I'm currently doing is making a class which implements CacheStore,
following the source of CacheAbstractJdbcStore to handle db connection,
reading, write etc, and build JSON object to return.

Not sure if this is the right way. Meanwhile, it''ll be great if Ignite can
provide such function by default.

View this message in context: http://apache-ignite-users.70518.x6.nabble.com/Using-Json-object-to-replace-POJO-tp1585p1597.html
Sent from the Apache Ignite Users mailing list archive at Nabble.com.

View raw message