/** * @see Handle#createCall */ public Call createCall(final Handle handle) { return handle.createCall(queryName); }
public void dropTableIfExist(String tableName) { DBI dbi = getDBI(); Handle handle = dbi.open(); if (dbType == DbType.H2) { handle.createCall("DROP TABLE " + tableName + " IF EXISTS CASCADE").invoke(); } else { handle.createCall("DROP TABLE IF EXISTS " + tableName + " CASCADE").invoke(); } }
public void resetTable(String tableName, String createTableSql) { DBI dbi = getDBI(); Handle handle = dbi.open(); if (dbType == DbType.H2) { handle.createCall("DROP TABLE " + tableName + " IF EXISTS CASCADE").invoke(); } else { handle.createCall("DROP TABLE IF EXISTS " + tableName + " CASCADE").invoke(); } handle.execute(createTableSql); handle.close(); } }
@Override public Object invoke(HandleDing ding, Object target, Object[] args, MethodProxy mp) { Handle h = ding.getHandle(); Call call = h.createCall(sql); populateSqlObjectData((ConcreteStatementContext)call.getContext()); applyCustomizers(call, args); applyBinders(call, args); OutParameters ou = call.invoke(); if (returnOutParams) { return ou; } else { return null; } } }
@Override public Object invoke(HandleDing ding, Object target, Object[] args, MethodProxy mp) { Handle h = ding.getHandle(); Call call = h.createCall(sql); populateSqlObjectData((ConcreteStatementContext)call.getContext()); applyCustomizers(call, args); applyBinders(call, args); OutParameters ou = call.invoke(); if (returnOutParams) { return ou; } else { return null; } } }