@Test public void testDeleteManyToManyAssociation() { String expectedQuery = "DELETE FROM issue_assignments " + "WHERE assignment_id = ? AND programmer_id = ?"; Many2ManyAssociation association = new Many2ManyAssociation( Programmer.class, Assignment.class, "issue_assignments", "assignment_id", "programmer_id"); String query = dialect.deleteManyToManyAssociation(association); a(query).shouldBeEqual(expectedQuery); }
@Override public String deleteManyToManyAssociation(Many2ManyAssociation association) { return "DELETE FROM " + association.getJoin() + " WHERE " + association.getSourceFkName() + " = ? AND " + association.getTargetFkName() + " = ?"; }
DefaultDialect implements Dialect { @Override public String deleteManyToManyAssociation(Many2ManyAssociation association) { return "DELETE FROM " + association.getJoin() + " WHERE " + association.getSourceFkName() + " = ? AND " + association.getTargetFkName() + " = ?"; } }
DefaultDialect implements Dialect { @Override public String deleteManyToManyAssociation(Many2ManyAssociation association) { return "DELETE FROM " + association.getJoin() + " WHERE " + association.getSourceFkName() + " = ? AND " + association.getTargetFkName() + " = ?"; }  }
DefaultDialect implements Dialect { @Override public String deleteManyToManyAssociation(Many2ManyAssociation association) { return "DELETE FROM " + association.getJoin() + " WHERE " + association.getSourceFkName() + " = ? AND " + association.getTargetFkName() + " = ?"; }  @Override String selectStar(String table); @Override String selectStar(String table, String where); @Override String selectStarParametrized(String table, String ... parameters); @Override String formSelect(String tableName, String[] columns, String subQuery, List<String> orderBys, long limit, long offset); @Override Object overrideDriverTypeConversion(MetaModel mm, String attributeName, Object value); @Override String selectCount(String from); @Override String selectCount(String table, String where); @Override String selectExists(MetaModel metaModel); @Override String selectManyToManyAssociation(Many2ManyAssociation association, String sourceFkColumnName, int questionsCount); @Override String insertManyToManyAssociation(Many2ManyAssociation association); @Override String insertParametrized(MetaModel metaModel, List<String> columns, boolean containsId); @Override String deleteManyToManyAssociation(Many2ManyAssociation association); @Override String insert(MetaModel metaModel, Map<String, Object> attributes, String ... replacements); @Override String update(MetaModel metaModel, Map<String, Object> attributes, String ... replacements); }
DefaultDialect implements Dialect { @Override public String deleteManyToManyAssociation(Many2ManyAssociation association) { return "DELETE FROM " + association.getJoin() + " WHERE " + association.getSourceFkName() + " = ? AND " + association.getTargetFkName() + " = ?"; }  @Override String selectStar(String table); @Override String selectStar(String table, String where); @Override String selectStarParametrized(String table, String ... parameters); @Override String formSelect(String tableName, String[] columns, String subQuery, List<String> orderBys, long limit, long offset); @Override Object overrideDriverTypeConversion(MetaModel mm, String attributeName, Object value); @Override String selectCount(String from); @Override String selectCount(String table, String where); @Override String selectExists(MetaModel metaModel); @Override String selectManyToManyAssociation(Many2ManyAssociation association, String sourceFkColumnName, int questionsCount); @Override String insertManyToManyAssociation(Many2ManyAssociation association); @Override String insertParametrized(MetaModel metaModel, List<String> columns, boolean containsId); @Override String deleteManyToManyAssociation(Many2ManyAssociation association); @Override String insert(MetaModel metaModel, Map<String, Object> attributes, String ... replacements); @Override String update(MetaModel metaModel, Map<String, Object> attributes, String ... replacements);  }