/** * Convenience method for counting the rows in the given table. * @param tableName table name to count rows in * @return the number of rows in the table * @see JdbcTestUtils#countRowsInTable */ protected int countRowsInTable(String tableName) { return JdbcTestUtils.countRowsInTable(this.jdbcTemplate, tableName); }
/** * Convenience method for dropping all of the specified tables. * <p>Use with caution outside of a transaction! * @param names the names of the tables to drop * @since 3.2 * @see JdbcTestUtils#dropTables */ protected void dropTables(String... names) { JdbcTestUtils.dropTables(this.jdbcTemplate, names); }
/** * Convenience method for deleting all rows from the specified tables. * <p>Use with caution outside of a transaction! * @param names the names of the tables from which to delete * @return the total number of rows deleted from all specified tables * @see JdbcTestUtils#deleteFromTables */ protected int deleteFromTables(String... names) { return JdbcTestUtils.deleteFromTables(this.jdbcTemplate, names); }
/** * Convenience method for deleting all rows from the given table, using the * provided {@code WHERE} clause. * <p>Use with caution outside of a transaction! * <p>See the Javadoc for {@link JdbcTestUtils#deleteFromTableWhere} for details. * @param tableName the name of the table to delete rows from * @param whereClause the {@code WHERE} clause to append to the query * @param args arguments to bind to the query (leaving it to the {@code * PreparedStatement} to guess the corresponding SQL type); may also contain * {@link org.springframework.jdbc.core.SqlParameterValue SqlParameterValue} * objects which indicate not only the argument value but also the SQL type * and optionally the scale. * @return the number of rows deleted from the table * @since 4.0 * @see JdbcTestUtils#deleteFromTableWhere */ protected int deleteFromTableWhere(String tableName, String whereClause, Object... args) { return JdbcTestUtils.deleteFromTableWhere(this.jdbcTemplate, tableName, whereClause, args); }
/** * Convenience method for counting the rows in the given table, using the * provided {@code WHERE} clause. * <p>See the Javadoc for {@link JdbcTestUtils#countRowsInTableWhere} for details. * @param tableName the name of the table to count rows in * @param whereClause the {@code WHERE} clause to append to the query * @return the number of rows in the table that match the provided * {@code WHERE} clause * @since 3.2 * @see JdbcTestUtils#countRowsInTableWhere */ protected int countRowsInTableWhere(String tableName, String whereClause) { return JdbcTestUtils.countRowsInTableWhere(this.jdbcTemplate, tableName, whereClause); }
/** * Convenience method for counting the rows in the given table. * @param tableName table name to count rows in * @return the number of rows in the table * @see JdbcTestUtils#countRowsInTable */ protected int countRowsInTable(String tableName) { return JdbcTestUtils.countRowsInTable(this.jdbcTemplate, tableName); }
/** * Convenience method for deleting all rows from the specified tables. * <p>Use with caution outside of a transaction! * @param names the names of the tables from which to delete * @return the total number of rows deleted from all specified tables * @see JdbcTestUtils#deleteFromTables */ protected int deleteFromTables(String... names) { return JdbcTestUtils.deleteFromTables(this.jdbcTemplate, names); }
/** * Convenience method for dropping all of the specified tables. * <p>Use with caution outside of a transaction! * @param names the names of the tables to drop * @since 3.2 * @see JdbcTestUtils#dropTables */ protected void dropTables(String... names) { JdbcTestUtils.dropTables(this.jdbcTemplate, names); }
/** * Convenience method for deleting all rows from the given table, using the * provided {@code WHERE} clause. * <p>Use with caution outside of a transaction! * <p>See the Javadoc for {@link JdbcTestUtils#deleteFromTableWhere} for details. * @param tableName the name of the table to delete rows from * @param whereClause the {@code WHERE} clause to append to the query * @param args arguments to bind to the query (leaving it to the {@code * PreparedStatement} to guess the corresponding SQL type); may also contain * {@link org.springframework.jdbc.core.SqlParameterValue SqlParameterValue} * objects which indicate not only the argument value but also the SQL type * and optionally the scale. * @return the number of rows deleted from the table * @since 4.0 * @see JdbcTestUtils#deleteFromTableWhere */ protected int deleteFromTableWhere(String tableName, String whereClause, Object... args) { return JdbcTestUtils.deleteFromTableWhere(this.jdbcTemplate, tableName, whereClause, args); }
/** * Convenience method for counting the rows in the given table, using the * provided {@code WHERE} clause. * <p>See the Javadoc for {@link JdbcTestUtils#countRowsInTableWhere} for details. * @param tableName the name of the table to count rows in * @param whereClause the {@code WHERE} clause to append to the query * @return the number of rows in the table that match the provided * {@code WHERE} clause * @since 3.2 * @see JdbcTestUtils#countRowsInTableWhere */ protected int countRowsInTableWhere(String tableName, String whereClause) { return JdbcTestUtils.countRowsInTableWhere(this.jdbcTemplate, tableName, whereClause); }
private int countRowsInTable(String tableName) { return JdbcTestUtils.countRowsInTable(this.jdbcTemplate, tableName); }
protected int deleteFromTables(String... names) { return JdbcTestUtils.deleteFromTables(this.jdbcTemplate, names); }
private int countRowsInTable(String tableName) { return JdbcTestUtils.countRowsInTable(this.jdbcTemplate, tableName); }
@Override protected JobInstanceDao getJobInstanceDao() { JdbcTestUtils.deleteFromTables(jdbcTemplate, "BATCH_JOB_EXECUTION_CONTEXT", "BATCH_STEP_EXECUTION_CONTEXT", "BATCH_STEP_EXECUTION", "BATCH_JOB_EXECUTION_PARAMS", "BATCH_JOB_EXECUTION", "BATCH_JOB_INSTANCE"); return jobInstanceDao; }
protected int countRowsInTable(String tableName) { return JdbcTestUtils.countRowsInTable(this.jdbcTemplate, tableName); }
@Override protected JobExecutionDao getJobExecutionDao() { JdbcTestUtils.deleteFromTables(jdbcTemplate, "BATCH_JOB_EXECUTION_CONTEXT", "BATCH_STEP_EXECUTION_CONTEXT", "BATCH_STEP_EXECUTION", "BATCH_JOB_EXECUTION", "BATCH_JOB_EXECUTION_PARAMS", "BATCH_JOB_INSTANCE"); return jobExecutionDao; }
protected int countRowsInTable(String tableName) { return JdbcTestUtils.countRowsInTable(this.jdbcTemplate, tableName); }
protected void assertNumUsers(int expected) { assertEquals("Number of rows in the 'user' table.", expected, JdbcTestUtils.countRowsInTable(jdbcTemplate, "user")); }
protected void assertNumUsers(int expected) { assertEquals("Number of rows in the 'user' table.", expected, JdbcTestUtils.countRowsInTable(jdbcTemplate, "user")); }
private void assertNumUsers(int expected) { assertEquals("Number of rows in the 'user' table", expected, JdbcTestUtils.countRowsInTable(this.jdbcTemplate, "user")); }