public class CacheJdbcPojoStoreFactory<K,V> extends Object implements javax.cache.configuration.Factory<CacheAbstractJdbcStore<K,V>>
Factory implementation for CacheJdbcPojoStore.
Use this factory to pass CacheJdbcPojoStore to CacheConfiguration.
<bean id= "myDataSource" class="org.h2.jdbcx.JdbcDataSource"/>
<bean id="ignite.cfg" class="org.apache.ignite.configuration.IgniteConfiguration">
...
<property name="cacheConfiguration">
<list>
<bean class="org.apache.ignite.configuration.CacheConfiguration">
<property name="name" value="myCache" />
...
<property name="cacheStoreFactory">
<bean class="org.apache.ignite.cache.store.jdbc.CacheJdbcPojoStoreFactory">
<property name="dataSourceBean" value="myDataSource" />
<property name="types">
<list>
<bean class="org.apache.ignite.cache.store.jdbc.JdbcType">
<property name="cacheName" value="myCache" />
<property name="databaseSchema" value="MY_DB_SCHEMA" />
<property name="databaseTable" value="PERSON" />
<property name="keyType" value="java.lang.Integer" />
<property name="keyFields">
<list>
<bean class="org.apache.ignite.cache.store.jdbc.JdbcTypeField">
<property name="databaseFieldType" >
<util:constant static-field="java.sql.Types.INTEGER"/>
</property>
<property name="databaseFieldName" value="ID" />
<property name="javaFieldType" value="java.lang.Integer" />
<property name="javaFieldName" value="id" />
</bean>
</list>
</property>
<property name="valueType" value="my.company.Person" />
<property name="valueFields">
<list>
<bean class="org.apache.ignite.cache.store.jdbc.JdbcTypeField">
<property name="databaseFieldType" >
<util:constant static-field="java.sql.Types.VARCHAR"/>
</property>
<property name="databaseFieldName" value="NAME" />
<property name="javaFieldType" value="java.lang.String" />
<property name="javaFieldName" value="name" />
</bean>
</list>
</property>
</bean>
</list>
</property>
</bean>
</property>
</bean>
</list>
</property>
</bean>
For information about Spring framework visit www.springframework.org
| Modifier and Type | Field and Description |
|---|---|
static int |
DFLT_BATCH_SIZE
Default batch size for put and remove operations.
|
static int |
DFLT_PARALLEL_LOAD_CACHE_MINIMUM_THRESHOLD
Default batch size for put and remove operations.
|
static int |
DFLT_WRITE_ATTEMPTS
Default value for write attempts.
|
| Constructor and Description |
|---|
CacheJdbcPojoStoreFactory() |
| Modifier and Type | Method and Description |
|---|---|
CacheJdbcPojoStore<K,V> |
create() |
int |
getBatchSize()
Get maximum batch size for delete and delete operations.
|
String |
getDataSourceBean()
Gets name of the data source bean.
|
JdbcDialect |
getDialect()
Get database dialect.
|
JdbcTypeHasher |
getHasher()
Gets hash code calculator.
|
int |
getMaximumPoolSize()
Get maximum workers thread count.
|
int |
getMaximumWriteAttempts()
Gets maximum number of write attempts in case of database error.
|
int |
getParallelLoadCacheMinimumThreshold()
Parallel load cache minimum row count threshold.
|
JdbcType[] |
getTypes()
Gets types known by store.
|
CacheJdbcPojoStoreFactory |
setBatchSize(int batchSize)
Set maximum batch size for write and delete operations.
|
CacheJdbcPojoStoreFactory<K,V> |
setDataSource(DataSource dataSrc)
Sets data source.
|
CacheJdbcPojoStoreFactory |
setDataSourceBean(String dataSrcBean)
Sets name of the data source bean.
|
CacheJdbcPojoStoreFactory |
setDialect(JdbcDialect dialect)
Set database dialect.
|
CacheJdbcPojoStoreFactory |
setHasher(JdbcTypeHasher hasher)
Sets hash code calculator.
|
CacheJdbcPojoStoreFactory |
setMaximumPoolSize(int maxPoolSize)
Set Maximum workers thread count.
|
CacheJdbcPojoStoreFactory |
setMaximumWriteAttempts(int maxWrtAttempts)
Sets maximum number of write attempts in case of database error.
|
CacheJdbcPojoStoreFactory |
setParallelLoadCacheMinimumThreshold(int parallelLoadCacheMinThreshold)
Parallel load cache minimum row count threshold.
|
CacheJdbcPojoStoreFactory |
setTypes(JdbcType... types)
Sets store configurations.
|
String |
toString() |
public static final int DFLT_WRITE_ATTEMPTS
public static final int DFLT_BATCH_SIZE
public static final int DFLT_PARALLEL_LOAD_CACHE_MINIMUM_THRESHOLD
public CacheJdbcPojoStore<K,V> create()
create in interface javax.cache.configuration.Factory<CacheAbstractJdbcStore<K,V>>public CacheJdbcPojoStoreFactory<K,V> setDataSource(DataSource dataSrc)
dataSrc - Data source.This for chaining.CacheAbstractJdbcStore.setDataSource(DataSource)public int getBatchSize()
public CacheJdbcPojoStoreFactory setBatchSize(int batchSize)
batchSize - Maximum batch size.This for chaining.public String getDataSourceBean()
public CacheJdbcPojoStoreFactory setDataSourceBean(String dataSrcBean)
dataSrcBean - Data source bean name.This for chaining.public JdbcDialect getDialect()
public CacheJdbcPojoStoreFactory setDialect(JdbcDialect dialect)
dialect - Database dialect.This for chaining.public int getMaximumPoolSize()
public CacheJdbcPojoStoreFactory setMaximumPoolSize(int maxPoolSize)
maxPoolSize - Max workers thread count.This for chaining.public int getMaximumWriteAttempts()
public CacheJdbcPojoStoreFactory setMaximumWriteAttempts(int maxWrtAttempts)
maxWrtAttempts - Number of write attempts.This for chaining.public int getParallelLoadCacheMinimumThreshold()
0 then load sequentially.public CacheJdbcPojoStoreFactory setParallelLoadCacheMinimumThreshold(int parallelLoadCacheMinThreshold)
parallelLoadCacheMinThreshold - Minimum row count threshold. If 0 then load sequentially.This for chaining.public JdbcType[] getTypes()
public CacheJdbcPojoStoreFactory setTypes(JdbcType... types)
types - Store should process.This for chaining.public JdbcTypeHasher getHasher()
public CacheJdbcPojoStoreFactory setHasher(JdbcTypeHasher hasher)
hasher - Hash code calculator.This for chaining.
Follow @ApacheIgnite
Ignite Fabric : ver. 1.5.11 Release Date : April 8 2016