private AbstractJdbcCacheStoreConfig buildJDBCStoreConfig(ModelNode store) {
boolean useEntryTable = store.hasDefined(ModelKeys.ENTRY_TABLE);
boolean useBucketTable = store.hasDefined(ModelKeys.BUCKET_TABLE);
if (useEntryTable && !useBucketTable) {
JdbcStringBasedCacheStoreConfig storeConfig = new JdbcStringBasedCacheStoreConfig();
storeConfig.setTableManipulation(this.buildEntryTableManipulation(store.get(ModelKeys.ENTRY_TABLE)));
return storeConfig;
} else if (useBucketTable && !useEntryTable) {
JdbcBinaryCacheStoreConfig storeConfig = new JdbcBinaryCacheStoreConfig();
storeConfig.setTableManipulation(this.buildBucketTableManipulation(store.get(ModelKeys.BUCKET_TABLE)));
return storeConfig;
}
// Else, use mixed mode
JdbcMixedCacheStoreConfig storeConfig = new JdbcMixedCacheStoreConfig();
storeConfig.setStringsTableManipulation(this.buildEntryTableManipulation(store.get(ModelKeys.ENTRY_TABLE)));
storeConfig.setBinaryTableManipulation(this.buildBucketTableManipulation(store.get(ModelKeys.BUCKET_TABLE)));
return storeConfig;
}