Return-Path: X-Original-To: apmail-ignite-user-archive@minotaur.apache.org Delivered-To: apmail-ignite-user-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id E20AE18CDF for ; Tue, 13 Oct 2015 09:08:05 +0000 (UTC) Received: (qmail 98448 invoked by uid 500); 13 Oct 2015 09:07:59 -0000 Delivered-To: apmail-ignite-user-archive@ignite.apache.org Received: (qmail 98409 invoked by uid 500); 13 Oct 2015 09:07:59 -0000 Mailing-List: contact user-help@ignite.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user@ignite.apache.org Delivered-To: mailing list user@ignite.apache.org Received: (qmail 98400 invoked by uid 99); 13 Oct 2015 09:07:59 -0000 Received: from mail-relay.apache.org (HELO mail-relay.apache.org) (140.211.11.15) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 13 Oct 2015 09:07:59 +0000 Received: from mail-ob0-f178.google.com (mail-ob0-f178.google.com [209.85.214.178]) by mail-relay.apache.org (ASF Mail Server at mail-relay.apache.org) with ESMTPSA id 3025F1A0098 for ; Tue, 13 Oct 2015 09:07:58 +0000 (UTC) Received: by obbbh8 with SMTP id bh8so8657765obb.0 for ; Tue, 13 Oct 2015 02:07:58 -0700 (PDT) X-Gm-Message-State: ALoCoQk/JNAIxa0LUK+l38kiJybxPIRmKV3t7OIxd9GfM3drIroa4w2A+pCMK2L9zXY4K6VU090b X-Received: by 10.182.200.132 with SMTP id js4mr18218410obc.10.1444727278373; Tue, 13 Oct 2015 02:07:58 -0700 (PDT) MIME-Version: 1.0 Received: by 10.202.223.67 with HTTP; Tue, 13 Oct 2015 02:07:18 -0700 (PDT) In-Reply-To: <1444707676042-1597.post@n6.nabble.com> References: <24889b5f.32cb.150599d173f.Coremail.xeseo@163.com> <1444707676042-1597.post@n6.nabble.com> From: Dmitriy Setrakyan Date: Tue, 13 Oct 2015 02:07:18 -0700 Message-ID: Subject: Re: Using Json object to replace POJO To: user Content-Type: multipart/alternative; boundary=001a11c2535839a5750521f8c8fc --001a11c2535839a5750521f8c8fc Content-Type: text/plain; charset=UTF-8 On Mon, Oct 12, 2015 at 8:41 PM, xeseo wrote: > 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 > > Yes, IGNITE-962 is the same thing. You will be able to run SQL over JSON when this ticket is complete. > > 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. It is the right away. > Meanwhile, it''ll be great if Ignite can provide such function by default. > I think we can consider it once the IGNITE-962 is implemented. > > > > -- > 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. > --001a11c2535839a5750521f8c8fc Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable


On Mon, Oct 12, 2015 at 8:41 PM, xeseo <xeseo@163.com> wrote= :
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 S= QL:
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=


Yes, IGNITE-962 is the same thing. You= will be able to run SQL over JSON when this ticket is complete.
= =C2=A0

dsetrakyan wrote
> JSONObject is also just a Java object.

Although JSON Object is also a Java POJO, but I don't think I ca= n 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.

It is t= he right away.
=C2=A0
Meanwhi= le, it''ll be great if Ignite can=C2=A0provide such function by def= ault.

I think we can consider it once t= he IGNITE-962 is implemented.
=C2=A0



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

--001a11c2535839a5750521f8c8fc--