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
.
Please note, that setDataSource(DataSource)
is deprecated and
setDataSourceFactory(Factory)
or
setDataSourceBean(String)
should be used instead.
<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 write and delete operations.
|
String |
getDataSourceBean()
Gets name of the data source bean.
|
javax.cache.configuration.Factory<DataSource> |
getDataSourceFactory()
Gets factory for underlying datasource.
|
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.
|
JdbcTypesTransformer |
getTransformer()
Gets types transformer.
|
JdbcType[] |
getTypes()
Gets types known by store.
|
boolean |
isSqlEscapeAll()
If
true all the SQL table and field names will be escaped with double quotes like
({@code "tableName"." |
CacheJdbcPojoStoreFactory |
setBatchSize(int batchSize)
Set maximum batch size for write and delete operations.
|
CacheJdbcPojoStoreFactory<K,V> |
setDataSource(DataSource dataSrc)
Deprecated.
|
CacheJdbcPojoStoreFactory |
setDataSourceBean(String dataSrcBean)
Sets name of the data source bean.
|
CacheJdbcPojoStoreFactory<K,V> |
setDataSourceFactory(javax.cache.configuration.Factory<DataSource> dataSrcFactory)
Sets factory for underlying datasource.
|
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<K,V> |
setSqlEscapeAll(boolean sqlEscapeAll)
If
true all the SQL table and field names will be escaped with double quotes like
({@code "tableName"." |
CacheJdbcPojoStoreFactory |
setTransformer(JdbcTypesTransformer transformer)
Sets types transformer.
|
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>>
@Deprecated 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.public JdbcTypesTransformer getTransformer()
public CacheJdbcPojoStoreFactory setTransformer(JdbcTypesTransformer transformer)
transformer
- Types transformer.This
for chaining.public javax.cache.configuration.Factory<DataSource> getDataSourceFactory()
public CacheJdbcPojoStoreFactory<K,V> setDataSourceFactory(javax.cache.configuration.Factory<DataSource> dataSrcFactory)
dataSrcFactory
- Datasource factory.this
for chaining.public boolean isSqlEscapeAll()
true
all 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.public CacheJdbcPojoStoreFactory<K,V> setSqlEscapeAll(boolean sqlEscapeAll)
true
all 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.sqlEscapeAll
- Flag value.this
for chaining.
Follow @ApacheIgnite
Ignite Database and Caching Platform : ver. 2.16.0 Release Date : December 15 2023