Search in sources :

Example 1 with Builder

use of com.google.cloud.spanner.Statement.Builder in project jans by JanssenProject.

the class SpannerOperationServiceImpl method applyParametersBinding.

private void applyParametersBinding(Statement.Builder builder, ConvertedExpression expression) throws IncompatibleTypeException {
    if (expression == null) {
        return;
    }
    Map<String, ValueWithStructField> queryParameters = expression.queryParameters();
    for (Entry<String, ValueWithStructField> queryParameterEntry : queryParameters.entrySet()) {
        String attributeName = queryParameterEntry.getKey();
        ValueWithStructField valueWithStructField = queryParameterEntry.getValue();
        ValueBinder<Builder> valueBinder = builder.bind(attributeName);
        setMutationBuilderValue(valueBinder, valueWithStructField.getStructField(), true, valueWithStructField.getValue());
    }
}
Also used : WriteBuilder(com.google.cloud.spanner.Mutation.WriteBuilder) Builder(com.google.cloud.spanner.Statement.Builder) ValueWithStructField(io.jans.orm.cloud.spanner.model.ValueWithStructField)

Aggregations

WriteBuilder (com.google.cloud.spanner.Mutation.WriteBuilder)1 Builder (com.google.cloud.spanner.Statement.Builder)1 ValueWithStructField (io.jans.orm.cloud.spanner.model.ValueWithStructField)1