simple fix for colon use in SQL select statement
This commit is contained in:
parent
d35071b910
commit
81a0bd8bc9
1 changed files with 13 additions and 11 deletions
|
@ -65,19 +65,21 @@ public class MixedParameterSql {
|
|||
}
|
||||
newSql.append(sql, searchIndex, nextColonIndex);
|
||||
String paramName = sql.substring(nextColonIndex + 1, endOfNameIndex);
|
||||
boolean secretParam = paramName.startsWith("secret");
|
||||
Object arg = nameToArg.get(paramName);
|
||||
if (arg instanceof RewriteArg) {
|
||||
newSql.append(((RewriteArg) arg).getSql());
|
||||
rewrittenArgs.add(paramName);
|
||||
} else {
|
||||
newSql.append('?');
|
||||
if (nameToArg.containsKey(paramName)) {
|
||||
argsList.add(secretParam ? new SecretArg(arg) : arg);
|
||||
if (!"".equals(paramName)) {
|
||||
boolean secretParam = paramName.startsWith("secret");
|
||||
Object arg = nameToArg.get(paramName);
|
||||
if (arg instanceof RewriteArg) {
|
||||
newSql.append(((RewriteArg) arg).getSql());
|
||||
rewrittenArgs.add(paramName);
|
||||
} else {
|
||||
throw new DatabaseException("The SQL requires parameter ':" + paramName + "' but no value was provided");
|
||||
newSql.append('?');
|
||||
if (nameToArg.containsKey(paramName)) {
|
||||
argsList.add(secretParam ? new SecretArg(arg) : arg);
|
||||
} else {
|
||||
throw new DatabaseException("The SQL requires parameter ':" + paramName + "' but no value was provided");
|
||||
}
|
||||
argNamesList.add(paramName);
|
||||
}
|
||||
argNamesList.add(paramName);
|
||||
}
|
||||
searchIndex = endOfNameIndex;
|
||||
} else {
|
||||
|
|
Loading…
Reference in a new issue