org.infinispan.persistence.jdbc.configuration.JdbcStringBasedStoreConfigurationBuilder Maven / Gradle / Ivy
package org.infinispan.persistence.jdbc.configuration;
import java.util.Map;
import java.util.Properties;
import org.infinispan.configuration.cache.PersistenceConfigurationBuilder;
import org.infinispan.configuration.parsing.XmlConfigHelper;
import org.infinispan.persistence.keymappers.DefaultTwoWayKey2StringMapper;
import org.infinispan.persistence.keymappers.Key2StringMapper;
import org.infinispan.commons.configuration.Builder;
/**
*
* JdbcStringBasedStoreConfigurationBuilder.
*
* @author Tristan Tarrant
* @since 5.2
*/
public class JdbcStringBasedStoreConfigurationBuilder extends AbstractJdbcStoreConfigurationBuilder {
private String key2StringMapper = DefaultTwoWayKey2StringMapper.class.getName();
private StringTableManipulationConfigurationBuilder table;
public JdbcStringBasedStoreConfigurationBuilder(PersistenceConfigurationBuilder builder) {
super(builder);
table = new StringTableManipulationConfigurationBuilder(this);
}
@Override
public JdbcStringBasedStoreConfigurationBuilder self() {
return this;
}
/**
* The class name of a {@link Key2StringMapper} to use for mapping keys to strings suitable for
* storage in a database table. Defaults to {@link DefaultTwoWayKey2StringMapper}
*/
public JdbcStringBasedStoreConfigurationBuilder key2StringMapper(String key2StringMapper) {
this.key2StringMapper = key2StringMapper;
return this;
}
/**
* The class of a {@link Key2StringMapper} to use for mapping keys to strings suitable for
* storage in a database table. Defaults to {@link DefaultTwoWayKey2StringMapper}
*/
public JdbcStringBasedStoreConfigurationBuilder key2StringMapper(Class extends Key2StringMapper> klass) {
this.key2StringMapper = klass.getName();
return this;
}
/**
* Allows configuration of table-specific parameters such as column names and types
*/
public StringTableManipulationConfigurationBuilder table() {
return table;
}
@Override
public JdbcStringBasedStoreConfigurationBuilder withProperties(Properties props) {
Map
© 2015 - 2025 Weber Informatics LLC | Privacy Policy