SpringNamedSqlGenerator implements SqlGenerator { public String getDeleteBySinglePkSql() { checkIsSinglePrimaryKey(); List<Column> primaryKeyColumns = getPrimaryKeyColumns(); StringBuilder sb = new StringBuilder("DELETE FROM ").append(getTableName()); sb.append(" WHERE "); sb.append(getSinglePrimaryKeyWhere()); return sb.toString(); } SpringNamedSqlGenerator(Table table); List<Column> getColumns(); String getTableName(); List<Column> getPrimaryKeyColumns(); Table getTable(); boolean isMultiPrimaryKey(); boolean isSinglePrimaryKey(); String getInsertSql(); String getDeleteByPkSql(); String getSelectByPkSql(); String getUpdateByPkSql(); String getDeleteByMultiPkSql(); String getDeleteBySinglePkSql(); String getSelectByMultiPkSql(); String getSelectBySinglePkSql(); String getColumnsSql(); String getColumnsSql(String columnPrefix);  }
@Test public void getDeleteBySinglePkSql() { System.out.println(t.getDeleteBySinglePkSql()); assertEquals("DELETE FROM user WHERE user_id = ?", t.getDeleteBySinglePkSql()); try { multiKeySqlGenerator.getDeleteBySinglePkSql(); fail(); }catch(IllegalStateException espected) { assertNotNull(espected); } }