Comment 3 for bug 653210

Revision history for this message
Timo Westkämper (timo-westkamper) wrote :

Got both fixed :

    @Test
    public void Delete_with_SubQuery_exists(){
        QSurvey survey1 = new QSurvey("s1");
        QEmployee employee = new QEmployee("e");
        SQLDeleteClause delete = new SQLDeleteClause(connection, SQLTemplates.DEFAULT,survey1);
        delete.where(survey1.name.eq("XXX"), new SQLSubQuery().from(employee).where(survey1.id.eq(employee.id)).exists());
        assertEquals("delete from SURVEY\n" +
              "where SURVEY.NAME = ? and exists (select 1\n" +
              "from EMPLOYEE2 e\n" +
              "where SURVEY.ID = e.ID)", delete.toString());
    }