Class CacheJdbcPojoStoreFactory<K,V>
- java.lang.Object
- 
- org.apache.ignite.cache.store.jdbc.CacheJdbcPojoStoreFactory<K,V>
 
- 
- All Implemented Interfaces:
- Serializable,- javax.cache.configuration.Factory<CacheAbstractJdbcStore<K,V>>
 
 public class CacheJdbcPojoStoreFactory<K,V> extends Object implements javax.cache.configuration.Factory<CacheAbstractJdbcStore<K,V>> Factoryimplementation forCacheJdbcPojoStore. Use this factory to passCacheJdbcPojoStoretoCacheConfiguration.Please note, that setDataSource(DataSource)is deprecated andsetDataSourceFactory(Factory)orsetDataSourceBean(String)should be used instead.Spring Example<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- See Also:
- Serialized Form
 
- 
- 
Field SummaryFields Modifier and Type Field Description static intDFLT_BATCH_SIZEDefault batch size for put and remove operations.static intDFLT_PARALLEL_LOAD_CACHE_MINIMUM_THRESHOLDDefault batch size for put and remove operations.static intDFLT_WRITE_ATTEMPTSDefault value for write attempts.
 - 
Constructor SummaryConstructors Constructor Description CacheJdbcPojoStoreFactory()
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description CacheJdbcPojoStore<K,V>create()intgetBatchSize()Get maximum batch size for write and delete operations.StringgetDataSourceBean()Gets name of the data source bean.javax.cache.configuration.Factory<DataSource>getDataSourceFactory()Gets factory for underlying datasource.JdbcDialectgetDialect()Get database dialect.JdbcTypeHashergetHasher()Gets hash code calculator.intgetMaximumPoolSize()Get maximum workers thread count.intgetMaximumWriteAttempts()Gets maximum number of write attempts in case of database error.intgetParallelLoadCacheMinimumThreshold()Parallel load cache minimum row count threshold.JdbcTypesTransformergetTransformer()Gets types transformer.JdbcType[]getTypes()Gets types known by store.booleanisSqlEscapeAll()Iftrueall the SQL table and field names will be escaped with double quotes like ("tableName"."fieldsName").CacheJdbcPojoStoreFactorysetBatchSize(int batchSize)Set maximum batch size for write and delete operations.CacheJdbcPojoStoreFactory<K,V>setDataSource(DataSource dataSrc)Deprecated.CacheJdbcPojoStoreFactorysetDataSourceBean(String dataSrcBean)Sets name of the data source bean.CacheJdbcPojoStoreFactory<K,V>setDataSourceFactory(javax.cache.configuration.Factory<DataSource> dataSrcFactory)Sets factory for underlying datasource.CacheJdbcPojoStoreFactorysetDialect(JdbcDialect dialect)Set database dialect.CacheJdbcPojoStoreFactorysetHasher(JdbcTypeHasher hasher)Sets hash code calculator.CacheJdbcPojoStoreFactorysetMaximumPoolSize(int maxPoolSize)Set Maximum workers thread count.CacheJdbcPojoStoreFactorysetMaximumWriteAttempts(int maxWrtAttempts)Sets maximum number of write attempts in case of database error.CacheJdbcPojoStoreFactorysetParallelLoadCacheMinimumThreshold(int parallelLoadCacheMinThreshold)Parallel load cache minimum row count threshold.CacheJdbcPojoStoreFactory<K,V>setSqlEscapeAll(boolean sqlEscapeAll)Iftrueall the SQL table and field names will be escaped with double quotes like ("tableName"."fieldsName").CacheJdbcPojoStoreFactorysetTransformer(JdbcTypesTransformer transformer)Sets types transformer.CacheJdbcPojoStoreFactorysetTypes(JdbcType... types)Sets store configurations.StringtoString()
 
- 
- 
- 
Field Detail- 
DFLT_WRITE_ATTEMPTSpublic static final int DFLT_WRITE_ATTEMPTS Default value for write attempts.- See Also:
- Constant Field Values
 
 - 
DFLT_BATCH_SIZEpublic static final int DFLT_BATCH_SIZE Default batch size for put and remove operations.- See Also:
- Constant Field Values
 
 - 
DFLT_PARALLEL_LOAD_CACHE_MINIMUM_THRESHOLDpublic static final int DFLT_PARALLEL_LOAD_CACHE_MINIMUM_THRESHOLD Default batch size for put and remove operations.- See Also:
- Constant Field Values
 
 
- 
 - 
Method Detail- 
createpublic CacheJdbcPojoStore<K,V> create() - Specified by:
- createin interface- javax.cache.configuration.Factory<K>
 
 - 
setDataSource@Deprecated public CacheJdbcPojoStoreFactory<K,V> setDataSource(DataSource dataSrc) Deprecated.Sets data source. Data source should be fully configured and ready-to-use.- Parameters:
- dataSrc- Data source.
- Returns:
- Thisfor chaining.
- See Also:
- CacheAbstractJdbcStore.setDataSource(DataSource)
 
 - 
getBatchSizepublic int getBatchSize() Get maximum batch size for write and delete operations.- Returns:
- Maximum batch size.
 
 - 
setBatchSizepublic CacheJdbcPojoStoreFactory setBatchSize(int batchSize) Set maximum batch size for write and delete operations.- Parameters:
- batchSize- Maximum batch size.
- Returns:
- Thisfor chaining.
 
 - 
getDataSourceBeanpublic String getDataSourceBean() Gets name of the data source bean.- Returns:
- Data source bean name.
 
 - 
setDataSourceBeanpublic CacheJdbcPojoStoreFactory setDataSourceBean(String dataSrcBean) Sets name of the data source bean.- Parameters:
- dataSrcBean- Data source bean name.
- Returns:
- Thisfor chaining.
 
 - 
getDialectpublic JdbcDialect getDialect() Get database dialect.- Returns:
- Database dialect.
 
 - 
setDialectpublic CacheJdbcPojoStoreFactory setDialect(JdbcDialect dialect) Set database dialect.- Parameters:
- dialect- Database dialect.
- Returns:
- Thisfor chaining.
 
 - 
getMaximumPoolSizepublic int getMaximumPoolSize() Get maximum workers thread count. These threads are responsible for queries execution.- Returns:
- Maximum workers thread count.
 
 - 
setMaximumPoolSizepublic CacheJdbcPojoStoreFactory setMaximumPoolSize(int maxPoolSize) Set Maximum workers thread count. These threads are responsible for queries execution.- Parameters:
- maxPoolSize- Max workers thread count.
- Returns:
- Thisfor chaining.
 
 - 
getMaximumWriteAttemptspublic int getMaximumWriteAttempts() Gets maximum number of write attempts in case of database error.- Returns:
- Maximum number of write attempts.
 
 - 
setMaximumWriteAttemptspublic CacheJdbcPojoStoreFactory setMaximumWriteAttempts(int maxWrtAttempts) Sets maximum number of write attempts in case of database error.- Parameters:
- maxWrtAttempts- Number of write attempts.
- Returns:
- Thisfor chaining.
 
 - 
getParallelLoadCacheMinimumThresholdpublic int getParallelLoadCacheMinimumThreshold() Parallel load cache minimum row count threshold.- Returns:
- If 0then load sequentially.
 
 - 
setParallelLoadCacheMinimumThresholdpublic CacheJdbcPojoStoreFactory setParallelLoadCacheMinimumThreshold(int parallelLoadCacheMinThreshold) Parallel load cache minimum row count threshold.- Parameters:
- parallelLoadCacheMinThreshold- Minimum row count threshold. If- 0then load sequentially.
- Returns:
- Thisfor chaining.
 
 - 
getTypespublic JdbcType[] getTypes() Gets types known by store.- Returns:
- Types known by store.
 
 - 
setTypespublic CacheJdbcPojoStoreFactory setTypes(JdbcType... types) Sets store configurations.- Parameters:
- types- Store should process.
- Returns:
- Thisfor chaining.
 
 - 
getHasherpublic JdbcTypeHasher getHasher() Gets hash code calculator.- Returns:
- Hash code calculator.
 
 - 
setHasherpublic CacheJdbcPojoStoreFactory setHasher(JdbcTypeHasher hasher) Sets hash code calculator.- Parameters:
- hasher- Hash code calculator.
- Returns:
- Thisfor chaining.
 
 - 
getTransformerpublic JdbcTypesTransformer getTransformer() Gets types transformer.- Returns:
- Types transformer.
 
 - 
setTransformerpublic CacheJdbcPojoStoreFactory setTransformer(JdbcTypesTransformer transformer) Sets types transformer.- Parameters:
- transformer- Types transformer.
- Returns:
- Thisfor chaining.
 
 - 
getDataSourceFactorypublic javax.cache.configuration.Factory<DataSource> getDataSourceFactory() Gets factory for underlying datasource.- Returns:
- Cache store factory.
 
 - 
setDataSourceFactorypublic CacheJdbcPojoStoreFactory<K,V> setDataSourceFactory(javax.cache.configuration.Factory<DataSource> dataSrcFactory) Sets factory for underlying datasource.- Parameters:
- dataSrcFactory- Datasource factory.
- Returns:
- thisfor chaining.
 
 - 
isSqlEscapeAllpublic boolean isSqlEscapeAll() Iftrueall the SQL table and field names will be escaped with double quotes like ("tableName"."fieldsName"). This enforces case sensitivity for field names and also allows having special characters in table and field names.- Returns:
- Flag value.
 
 - 
setSqlEscapeAllpublic CacheJdbcPojoStoreFactory<K,V> setSqlEscapeAll(boolean sqlEscapeAll) Iftrueall the SQL table and field names will be escaped with double quotes like ("tableName"."fieldsName"). This enforces case sensitivity for field names and also allows having special characters in table and field names.- Parameters:
- sqlEscapeAll- Flag value.
- Returns:
- thisfor chaining.
 
 
- 
 
-