Search in sources :

Example 1 with SettableDataSetterFactory

use of org.simpleflatmapper.datastax.impl.SettableDataSetterFactory in project SimpleFlatMapper by arnaudroger.

the class DataTypeTest method getSetter.

public static <N> Setter<SettableByIndexData, N> getSetter(Class<N> target, DataType dataType) throws InstantiationException, IllegalAccessException, InvocationTargetException, NoSuchMethodException, ClassNotFoundException {
    MapperConfig<DatastaxColumnKey, FieldMapperColumnDefinition<DatastaxColumnKey>> mapperConfig = MapperConfig.<DatastaxColumnKey>fieldMapperConfig();
    ReflectionService reflectionService = ReflectionService.newInstance();
    SettableDataSetterFactory factory = new SettableDataSetterFactory(mapperConfig, reflectionService);
    DatastaxColumnKey columnKey = new DatastaxColumnKey("col", 1, dataType);
    return factory.getSetter(newPM(target, dataType, columnKey));
}
Also used : FieldMapperColumnDefinition(org.simpleflatmapper.map.property.FieldMapperColumnDefinition) DatastaxColumnKey(org.simpleflatmapper.datastax.DatastaxColumnKey) SettableDataSetterFactory(org.simpleflatmapper.datastax.impl.SettableDataSetterFactory) ReflectionService(org.simpleflatmapper.reflect.ReflectionService)

Aggregations

DatastaxColumnKey (org.simpleflatmapper.datastax.DatastaxColumnKey)1 SettableDataSetterFactory (org.simpleflatmapper.datastax.impl.SettableDataSetterFactory)1 FieldMapperColumnDefinition (org.simpleflatmapper.map.property.FieldMapperColumnDefinition)1 ReflectionService (org.simpleflatmapper.reflect.ReflectionService)1