use of org.umlg.sqlg.sql.parse.SchemaTableTree in project sqlg by pietermartin.
the class SqlgUtil method setParametersOnStatement.
public static void setParametersOnStatement(SqlgGraph sqlgGraph, LinkedList<SchemaTableTree> schemaTableTreeStack, PreparedStatement preparedStatement, int parameterIndex) throws SQLException {
Multimap<String, Object> keyValueMap = LinkedListMultimap.create();
for (SchemaTableTree schemaTableTree : schemaTableTreeStack) {
for (HasContainer hasContainer : schemaTableTree.getHasContainers()) {
if (!sqlgGraph.getSqlDialect().supportsBulkWithinOut() || !isBulkWithinAndOut(sqlgGraph, hasContainer)) {
WhereClause whereClause = WhereClause.from(hasContainer.getPredicate());
whereClause.putKeyValueMap(hasContainer, keyValueMap);
}
}
for (AndOrHasContainer andOrHasContainer : schemaTableTree.getAndOrHasContainers()) {
andOrHasContainer.setParameterOnStatement(keyValueMap);
}
}
List<ImmutablePair<PropertyType, Object>> typeAndValues = SqlgUtil.transformToTypeAndValue(keyValueMap);
// This is for selects
setKeyValuesAsParameter(sqlgGraph, false, parameterIndex, preparedStatement, typeAndValues);
}
Aggregations