You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ignite.apache.org by Shawn Du <sh...@neulion.com.cn> on 2017/02/03 08:49:45 UTC

equivalent xml configuration with code.

Hi,

 

CacheConfiguration cacheConfiguration = new CacheConfiguration();

cacheConfiguration.setTypes(String.class, <some class>);

cacheConfiguration.setIndexedTypes(String.class, <some class>);

 

what's equivalent xml configuration with above code?

 

Thanks

Shawn


Re: equivalent xml configuration with code.

Posted by vkulichenko <va...@gmail.com>.
Or you can just provide indexed types:

<property name="indexedTypes">
    <list>
        <value>java.lang.String</value>
        <value><some class></value>
    </list>
</property>

Ignite XML configuration is based on Spring [1], so you can use anything
available there.

[1]
https://docs.spring.io/spring/docs/current/spring-framework-reference/html/beans.html

-Val



--
View this message in context: http://apache-ignite-users.70518.x6.nabble.com/equivalent-xml-configuration-with-code-tp10413p10426.html
Sent from the Apache Ignite Users mailing list archive at Nabble.com.

Re: equivalent xml configuration with code.

Posted by Andrey Mashenkov <an...@gmail.com>.
Hi Shawn,
types whose fields are configured with CacheConfiguration.setIndexedTypes
method are internally turned into query entities [1]

Xml configuration will looks like this

<bean class="org.apache.ignite.configuration.CacheConfiguration">
       <property name="queryEntities">

        <list>
            <bean class="org.apache.ignite.cache.QueryEntity">
                <property name="keyType" value="java.lang.String"/>
                <property name="valueType" value="<some class>"/>

......


[1]
http://apacheignite.gridgain.org/docs/indexes#queryentity-based-configuration


On Fri, Feb 3, 2017 at 11:49 AM, Shawn Du <sh...@neulion.com.cn> wrote:

> Hi,
>
>
>
> CacheConfiguration cacheConfiguration = new CacheConfiguration();
>
> cacheConfiguration.setTypes(String.class, <some class>);
>
> cacheConfiguration.setIndexedTypes(String.class, <some class>);
>
>
>
> what’s equivalent xml configuration with above code?
>
>
>
> Thanks
>
> Shawn
>



-- 
С уважением,
Машенков Андрей Владимирович
Тел. +7-921-932-61-82

Best regards,
Andrey V. Mashenkov
Cerr: +7-921-932-61-82