ignite-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Vladislav Pyatkov <vldpyat...@gmail.com>
Subject Re: How to save a list of value (such as strings or numbers) in cache with write through enabled?
Date Fri, 08 Jul 2016 16:55:03 GMT
Hello,

You can use org.apache.ignite.cache.store.jdbc.CacheJdbcBlobStore instand
of CacheJdbcPojoStore
In the case key and value will be serialized to byte array and wrote to
database (in ENTRIES table).

Other way (for CacheJdbcPojoStore) you can use java.sql.Types#ARRAY
like this
new JdbcTypeField(Types.ARRAY, "ARR", String.class, "arr"))
or in xml.


On Fri, Jul 8, 2016 at 9:22 AM, Zhengqingzheng <zhengqingzheng@huawei.com>
wrote:

> Hi there,
>
> In ignite cache, I can define a list of objects as one big object and save
> into cache. However, How to enable write behind or write through to
> database, when I want to write the value list into one column cell?
>
> I know that there are jdbc mappings such as :
>
> <bean class="org.apache.ignite.cache.store.jdbc.JdbcTypeField">
>
>                                      <property name="databaseFieldType">
>
>                                                <util:constant
> static-field="java.sql.Types.SMALLINT"/>
>
>                                      </property>
>
>                                      <property name="databaseFieldName"
> value="FIELDNUM"/>
>
>                                      <property name="javaFieldType"
> value="java.lang.Integer"/>
>
>                                      <property name="javaFieldName"
> value="fieldnum"/>
>
>                             </bean>
>
> to build the default type mappings.
>
>
>
> How to do the same configuration with list of objects (such as strings)?
>
>
>
> Best regards,
>
> Kevin
>



-- 
Vladislav Pyatkov

Mime
View raw message