Package com.mysema.query.sql.dml

Examples of com.mysema.query.sql.dml.SQLDeleteClause


        this.connection = connection;
    }

    @Override
    public final SQLDeleteClause delete(RelationalPath<?> path) {
        return new SQLDeleteClause(connection.get(), configuration, path);
    }
View Full Code Here


    @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 EMPLOYEE e\n" +
                     "where SURVEY.ID = e.ID)", delete.toString());
    }
View Full Code Here

        sqlInsertClause.addListener(new TestLoggingListener());
        return sqlInsertClause;
    }

    protected SQLDeleteClause delete(RelationalPath<?> e) {
        SQLDeleteClause sqlDeleteClause = new SQLDeleteClause(connection, configuration, e);
        sqlDeleteClause.addListener(new TestLoggingListener());
        return sqlDeleteClause;
    }
View Full Code Here

    @Test
    public void Batch() throws SQLException{
        insert(survey).values(2, "A","B").execute();
        insert(survey).values(3, "B","C").execute();

        SQLDeleteClause delete = delete(survey);
        delete.where(survey.name.eq("A")).addBatch();
        delete.where(survey.name.eq("B")).addBatch();
        assertEquals(2, delete.execute());
    }
View Full Code Here

    @ExcludeIn({CUBRID, SQLITE})
    public void Batch_Templates() throws SQLException{
        insert(survey).values(2, "A","B").execute();
        insert(survey).values(3, "B","C").execute();

        SQLDeleteClause delete = delete(survey);
        delete.where(survey.name.eq(Expressions.stringTemplate("'A'"))).addBatch();
        delete.where(survey.name.eq(Expressions.stringTemplate("'B'"))).addBatch();
        assertEquals(2, delete.execute());
    }
View Full Code Here

    @Test
    public void Delete_with_SubQuery_exists() {
        QSurvey survey1 = new QSurvey("s1");
        QEmployee employee = new QEmployee("e");
        SQLDeleteClause delete = delete(survey1);
        delete.where(survey1.name.eq("XXX"),
                sq().from(employee).where(survey1.id.eq(employee.id)).exists());
        delete.execute();
    }
View Full Code Here

        Param<Integer> param = new Param<Integer>(Integer.class, "param");
        SQLSubQuery sq = sq().from(employee).where(employee.id.eq(param));
        sq.set(param, -12478923);

        SQLDeleteClause delete = delete(survey1);
        delete.where(survey1.name.eq("XXX"), sq.exists());
        delete.execute();
    }
View Full Code Here

    @Test
    public void Delete_with_SubQuery_exists2() {
        QSurvey survey1 = new QSurvey("s1");
        QEmployee employee = new QEmployee("e");
        SQLDeleteClause delete = delete(survey1);
        delete.where(survey1.name.eq("XXX"),
                sq().from(employee).where(survey1.name.eq(employee.lastname)).exists());
        delete.execute();
    }
View Full Code Here

TOP

Related Classes of com.mysema.query.sql.dml.SQLDeleteClause

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.