All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.simpleflatmapper.datastax.BoundStatementMapper Maven / Gradle / Ivy

There is a newer version: 8.2.3
Show newest version
package org.simpleflatmapper.datastax;

import com.datastax.driver.core.BoundStatement;
import com.datastax.driver.core.SettableByIndexData;
import org.simpleflatmapper.map.Mapper;
import org.simpleflatmapper.util.ErrorHelper;


public class BoundStatementMapper {
    private final Mapper mapper;

    public BoundStatementMapper(Mapper 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 +
                '}';
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy