Hello, Arthi

Your assumption is correct, in order to run queries you need to use proper
configuration
with "queryEntities" property defined for the cache as described in
documentation [1].

For the "Organization" type that you mentioned it should contain at least
the following:

<bean class="org.apache.ignite.configuration.CacheConfiguration">
<property name="name" value="CacheName"/>

<property name="queryEntities">
<list>
<bean class="org.apache.ignite.cache.QueryEntity">
<property name="keyType" value="java.lang.Integer"/>
<property name="valueType" value="Organization"/>
<property name="fields">
<map>
<entry key="name" value="java.lang.String"/>
<entry key="addr" value="Address"/>
</map>
</property>
</bean>
</list>
</property>
</bean>

After that you can get "CacheName" cache and run queries on it using fields
that
you have declared in "queryEntities".

Hope it helps.

[1] -
https://apacheignite-cpp.readme.io/docs/sql-queries#query-configuration-using-queryentity

Best Regards,
Igor

On Wed, Mar 9, 2016 at 10:06 AM, arthi <[email protected]>
wrote:

> Thanks Vladimir.
>
> I did have a look at the URLs, and also your examples in git hub. I am
> using
> the organization.h in the git hub and want to just run a SQL query on a
> cache with Organization objects.
> I get this error -
>  Indexing is disabled for cache: myCache. Use setIndexedTypes or
> setTypeMetadata methods on CacheConfiguration to enable.
>
> I assume this is to do with the XML config (Query Entities ) I need to
> define in the
> platforms/cpp/examples/config/example-cache.xml.
>
> Can you please give me a sample for this?
>
> I am doing good with the Java API, I had used @QuerySqlField annotations in
> my Java code, and could build up the caches. But, I need to have a C++
> client to read this data, as my application is in C++.
>
> Pls let me know if I am missing something.
>
> Thanks,
> Arthi
>
>
>
> --
> View this message in context:
> http://apache-ignite-users.70518.x6.nabble.com/C-Client-for-SQL-Queries-tp3407p3411.html
> Sent from the Apache Ignite Users mailing list archive at Nabble.com.
>

Reply via email to