use of org.eclipse.scout.rt.server.jdbc.parsers.token.ValueOutputToken in project scout.rt by eclipse.
the class StatementProcessorTest method exec.
private String[] exec(final boolean checkForDuplicateBinds, final String statement, final Object... binds) {
final Collection<String> duplicates = new ArrayList<>();
final AbstractSqlService sqlService = new AbstractSqlService() {
};
new StatementProcessor(sqlService, statement, binds) {
@Override
protected boolean isBindDuplicateCheckEnabled() {
return checkForDuplicateBinds;
}
@Override
protected void onDuplicateBind(IToken token) {
if (token instanceof ValueInputToken) {
duplicates.add(((ValueInputToken) token).getName());
} else if (token instanceof ValueOutputToken) {
duplicates.add(((ValueOutputToken) token).getName());
} else {
throw new ProcessingException("Unexpected token: {}", token);
}
}
}.simulate();
return duplicates.toArray(new String[duplicates.size()]);
}
Aggregations