use of org.simpleflatmapper.datastax.BoundStatementMapper in project SimpleFlatMapper by arnaudroger.
the class DatastaxCrudFactory method keySetter.
private static <K> BoundStatementMapper<K> keySetter(Type keyTarget, TableMetadata tableMetadata, DatastaxMapperFactory mapperFactory, int offset) {
SettableDataMapperBuilder<K> mapperBuilder = mapperFactory.newBuilderFrom(keyTarget);
int i = offset;
for (ColumnMetadata columnMetadata : tableMetadata.getPrimaryKey()) {
mapperBuilder.addColumn(DatastaxColumnKey.of(columnMetadata, i++));
}
return new BoundStatementMapper<K>(mapperBuilder.mapper());
}
use of org.simpleflatmapper.datastax.BoundStatementMapper in project SimpleFlatMapper by arnaudroger.
the class DatastaxCrudFactory method insertSetter.
private static <T> BoundStatementMapper<T> insertSetter(Type target, TableMetadata tableMetadata, DatastaxMapperFactory mapperFactory, int offset) {
SettableDataMapperBuilder<T> mapperBuilder = mapperFactory.newBuilderFrom(target);
int i = offset;
for (ColumnMetadata columnMetadata : tableMetadata.getColumns()) {
mapperBuilder.addColumn(DatastaxColumnKey.of(columnMetadata, i++));
}
return new BoundStatementMapper<T>(mapperBuilder.mapper());
}
Aggregations