Commit 869a7164 authored by Matija Obreza's avatar Matija Obreza
Browse files

Add % to "like" parameters

parent d7e5a8f8
......@@ -299,7 +299,7 @@ public class DirectMysqlQuery {
// must be an number
sb.append("\n ( ").append(dbName);
sb.append(" LIKE ? ) ");
addParam(params, like);
addParamLike(params, like);
}
}
......@@ -371,6 +371,15 @@ public class DirectMysqlQuery {
else if (JsonNodeType.NUMBER == value.getNodeType())
params.add(value.asDouble());
}
private void addParamLike(List<Object> params, JsonNode value) {
if (JsonNodeType.STRING == value.getNodeType())
params.add(value.asText()+"%");
else if (JsonNodeType.BOOLEAN == value.getNodeType())
params.add(value.asBoolean());
else if (JsonNodeType.NUMBER == value.getNodeType())
params.add(value.asDouble());
}
public String getCountQuery(String countWhat) {
if (LOG.isDebugEnabled()) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment