AbstractSQLBuilder { public String buildDeleteSQL(final DataRecord dataRecord, final Collection<Column> conditionColumns) { String sqlCacheKey = DELETE_SQL_CACHE_KEY_PREFIX + dataRecord.getTableName(); if (!sqlCacheMap.containsKey(sqlCacheKey)) { sqlCacheMap.put(sqlCacheKey, buildDeleteSQLInternal(dataRecord.getTableName(), conditionColumns)); } return sqlCacheMap.get(sqlCacheKey); }  String buildInsertSQL(final DataRecord dataRecord); String buildUpdateSQL(final DataRecord dataRecord, final Collection<Column> conditionColumns); String buildDeleteSQL(final DataRecord dataRecord, final Collection<Column> conditionColumns); String buildCountSQL(final String tableName);  }
@Test public void assertBuildDeleteSQLWithPrimaryKey() { String actual = sqlBuilder.buildDeleteSQL(mockDataRecord("t3"), RecordUtil.extractPrimaryColumns(mockDataRecord("t3"))); assertThat(actual, is("DELETE FROM `t3` WHERE `id` = ?")); }
@Test public void assertBuildDeleteSQLWithConditionColumns() { DataRecord dataRecord = mockDataRecord("t3"); String actual = sqlBuilder.buildDeleteSQL(dataRecord, mockConditionColumns(dataRecord)); assertThat(actual, is("DELETE FROM `t3` WHERE `id` = ? and `sc` = ?")); }