|
15 | 15 | */
|
16 | 16 | package com.datastax.cdm.cql.statement;
|
17 | 17 |
|
| 18 | +import java.time.Duration; |
| 19 | +import java.util.ArrayList; |
| 20 | +import java.util.List; |
| 21 | + |
| 22 | +import org.slf4j.Logger; |
| 23 | +import org.slf4j.LoggerFactory; |
| 24 | + |
18 | 25 | import com.datastax.cdm.cql.EnhancedSession;
|
19 | 26 | import com.datastax.cdm.properties.IPropertyHelper;
|
20 | 27 | import com.datastax.cdm.properties.KnownProperties;
|
21 | 28 | import com.datastax.cdm.properties.PropertyHelper;
|
22 | 29 | import com.datastax.oss.driver.api.core.cql.BoundStatement;
|
23 | 30 | import com.datastax.oss.driver.api.core.cql.Row;
|
24 |
| -import org.slf4j.Logger; |
25 |
| -import org.slf4j.LoggerFactory; |
26 |
| - |
27 |
| -import java.util.ArrayList; |
28 |
| -import java.util.List; |
29 |
| -import java.time.Duration; |
30 | 31 |
|
31 | 32 | public class TargetInsertStatement extends TargetUpsertStatement {
|
32 | 33 | public final Logger logger = LoggerFactory.getLogger(this.getClass().getName());
|
@@ -75,12 +76,12 @@ protected BoundStatement bind(Row originRow, Row targetRow, Integer ttl, Long wr
|
75 | 76 |
|
76 | 77 | boundStatement = boundStatement.set(currentBindIndex++, bindValue, cqlTable.getBindClass(targetIndex));
|
77 | 78 | } catch (Exception e) {
|
78 |
| - logger.error("Error trying to bind value:" + bindValue + " of class:" |
79 |
| - + (null == bindValue ? "unknown" : bindValue.getClass().getName()) + " to column:" |
80 |
| - + targetColumnNames.get(targetIndex) + " of targetDataType:" |
81 |
| - + targetColumnTypes.get(targetIndex) + "/" + cqlTable.getBindClass(targetIndex).getName() |
82 |
| - + " at column index:" + targetIndex + " and bind index: " + (currentBindIndex - 1) |
83 |
| - + " of statement:" + this.getCQL()); |
| 79 | + logger.error( |
| 80 | + "Error trying to bind value: {} of class: {} to column: {} of targetDataType: {}/{} at column index: {} and bind index: {} of statement: {}", |
| 81 | + bindValue, (null == bindValue ? "unknown" : bindValue.getClass().getName()), |
| 82 | + targetColumnNames.get(targetIndex), targetColumnTypes.get(targetIndex), |
| 83 | + cqlTable.getBindClass(targetIndex).getName(), targetIndex, (currentBindIndex - 1), |
| 84 | + this.getCQL()); |
84 | 85 | throw new RuntimeException("Error trying to bind value: ", e);
|
85 | 86 | }
|
86 | 87 | }
|
|
0 commit comments