Skip to content

Commit

Permalink
Require List type for query parameters
Browse files Browse the repository at this point in the history
  • Loading branch information
reugn committed Jan 1, 2024
1 parent dc12315 commit a1ce87d
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions src/main/java/com/aerospike/jdbc/AerospikeStatement.java
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
import java.sql.SQLFeatureNotSupportedException;
import java.sql.SQLWarning;
import java.sql.Statement;
import java.util.Collection;
import java.util.List;
import java.util.logging.Logger;

import static java.lang.String.format;
Expand Down Expand Up @@ -60,7 +60,7 @@ protected void runQuery(AerospikeQuery query) {
updateCount = result.getRight();
}

protected AerospikeQuery parseQuery(String sql, Collection<Object> sqlParameters) throws SQLException {
protected AerospikeQuery parseQuery(String sql, List<Object> sqlParameters) throws SQLException {
sql = sql.replace("\n", " ");
AerospikeQuery query;
try {
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/com/aerospike/jdbc/model/AerospikeQuery.java
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ public AerospikeQuery() {
this.queryType = QueryType.UNKNOWN;
}

public static AerospikeQuery parse(String sql, Collection<Object> sqlParameters) throws SqlParseException {
public static AerospikeQuery parse(String sql, List<Object> sqlParameters) throws SqlParseException {
SqlParser parser = SqlParser.create(sql, sqlParserConfig);
SqlNode parsed = parser.parseQuery();
return parsed.accept(new AerospikeSqlVisitor(sqlParameters));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@

import javax.annotation.Nullable;
import java.math.BigDecimal;
import java.util.Collection;
import java.util.Iterator;
import java.util.List;
import java.util.stream.Collectors;

import static com.aerospike.jdbc.util.Constants.UNSUPPORTED_QUERY_TYPE_MESSAGE;
Expand All @@ -31,7 +31,7 @@ public AerospikeSqlVisitor() {
this(null);
}

public AerospikeSqlVisitor(@Nullable Collection<Object> sqlParameters) {
public AerospikeSqlVisitor(@Nullable List<Object> sqlParameters) {
query = new AerospikeQuery();
sqlParametersIterator = sqlParameters != null ? sqlParameters.iterator() : null;
}
Expand Down

0 comments on commit a1ce87d

Please sign in to comment.