org.simpleflatmapper.datastax.BoundStatementMapper Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of sfm-datastax Show documentation
Show all versions of sfm-datastax Show documentation
Cassandra Datastax SFM supports.
package org.simpleflatmapper.datastax;
import com.datastax.driver.core.BoundStatement;
import com.datastax.driver.core.SettableByIndexData;
import org.simpleflatmapper.map.FieldMapper;
import org.simpleflatmapper.map.SourceMapper;
import org.simpleflatmapper.util.ErrorHelper;
public class BoundStatementMapper {
private final FieldMapper mapper;
public BoundStatementMapper(FieldMapper mapper) {
this.mapper = mapper;
}
public BoundStatement mapTo(T object, BoundStatement boundStatement) {
try {
mapper.mapTo(object, boundStatement, null);
} catch (Exception e) {
ErrorHelper.rethrow(e);
}
return boundStatement;
}
@Override
public String toString() {
return "BoundStatementMapper{" +
"mapper=" + mapper +
'}';
}
}