Hi,

You have pogo class - your.package.EquityClass wuth next fields:

    Long equityID; 
    private ListingCode firstCode; 
    private String equityName; 
    private String equityType; 
    private String equityClass; 
    private Set<Listing> listings; 

 and you are going to store in into ignite. In this case, if you can do it
like next:

<bean class="org.apache.ignite.configuration.CacheConfiguration">
    <property name="name" value="CACHE_NAME"/>
    <property name="sqlSchema" value="SQL_SCHEMA"/>
    <property name="cacheMode" value="PARTITIONED"/>
    <property name="atomicityMode" value="TRANSACTIONAL"/>
    <bean class="org.apache.ignite.cache.QueryEntity">
        <property name="keyType" value="java.lang.Long"/>
        <property name="valueType" value="your.package.EquityClass"/>
        <property name="tableName" value="EquityClassTable"/>
        <property name="fields">
            <map>
                <entry key="equityID" value="java.lang.Long"/>
                <entry key="equityName" value="java.lang.String"/>
                <entry key="equityType" value="java.lang.String"/>
                <entry key="equityClass" value="java.lang.String"/>
                <entry key="listings" value="java.util.HashSet"/>
                <entry key="firstCode" value="your.package.ListingCode"/>
            </map>
        </property>
        <property name="keyFields">
            <set>
                <value>equityID</value>
            </set>
        </property>
        <property name="indexes">
            <list>
                <bean class="org.apache.ignite.cache.QueryIndex">
                    <property name="name" value="EquityClassIdx"/>
                    <property name="indexType" value="SORTED"/>
                    <property name="fields">
                        <map>
                            <entry key="equityID" value="true"/>
                        </map>
                    </property>
                </bean>
            </list>
        </property>
    </bean>
</bean>

After that you can use it as next:

IgniteCache<Long, EquityClass> cache = ign.getOrCreateCache("CACHE_NAME");

BR,
Andrei



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

Reply via email to