public ReusableStringTemplate3StatementLocator(final Class baseClass, final boolean allowImplicitTemplateGroup, final boolean treatLiteralsAsTemplates) { this(mungify("/" + baseClass.getName()) + ".sql.stg", allowImplicitTemplateGroup, treatLiteralsAsTemplates); }
@BeforeMethod(groups = "slow") public void cleanupDb() throws Exception { cleanupDb("drop table if exists " + TABLE_NAME + ";\n" + "create table " + TABLE_NAME + " (id int primary key)"); // This will break - as it generates the following query on the second invocation: // delete from somethingsomething //dbi.setStatementLocator(new StringTemplate3StatementLocator(SomethingLiteralSqlDao.class, true, true)); }
@Test(groups = "slow") public void testMultipleInvocationsWithoutLiterals() throws IOException { dbi.setStatementLocator(new ReusableStringTemplate3StatementLocator("/com/ning/billing/commons/jdbi/SomethingNonLiteralSqlDao.sql.stg", true, true)); final SomethingNonLiteralSqlDao somethingNonLiteralSqlDao = dbi.onDemand(SomethingNonLiteralSqlDao.class); somethingNonLiteralSqlDao.delete(TABLE_NAME); somethingNonLiteralSqlDao.delete(TABLE_NAME); }
@Test(groups = "slow") public void testMultipleInvocationsWithLiterals() throws IOException { dbi.setStatementLocator(new ReusableStringTemplate3StatementLocator(SomethingLiteralSqlDao.class, true, true)); final SomethingLiteralSqlDao somethingLiteralSqlDao = dbi.onDemand(SomethingLiteralSqlDao.class); somethingLiteralSqlDao.delete(TABLE_NAME); somethingLiteralSqlDao.delete(TABLE_NAME); }
public ReusableStringTemplate3StatementLocator(final Class baseClass, final boolean allowImplicitTemplateGroup, final boolean treatLiteralsAsTemplates) { this(mungify("/" + baseClass.getName()) + ".sql.stg", allowImplicitTemplateGroup, treatLiteralsAsTemplates); }
public ReusableStringTemplate3StatementLocator(final Class baseClass) { this(mungify("/" + baseClass.getName()) + ".sql.stg", false, false); }
public ReusableStringTemplate3StatementLocator(final Class baseClass) { this(mungify("/" + baseClass.getName()) + ".sql.stg", false, false); }