SQL : Support for batch in DML clauses

Bug #608105 reported by Timo Westkämper on 2010-07-21
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Querydsl
Fix Released
Undecided
Unassigned

Bug Description

Support for batch in DML clauses

I will be out of the office starting 21/07/2010 and will not return until
09/08/2010.

summary: - SQL : Support for batch in SQLUpdateClause
+ SQL : Support for batch in DML clauses
description: updated
Changed in querydsl:
status: New → In Progress

Support for batch in SQLInsertClause has been added

Batch support for INSERT, DELETE and UPDATE is available.

UPDATE :

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

        SQLUpdateClause update = update(survey);
        update.set(survey.name, "AA").where(survey.name.eq("A")).addBatch();
        update.set(survey.name, "BB").where(survey.name.eq("B")).addBatch();
        assertEquals(2, update.execute());
    }

DELETE :

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

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

INSERT :

    @Test
    public void batch(){
        SQLInsertClause insert = insert(survey);
        insert.set(survey.id, 5).set(survey.name, "5").addBatch();
        insert.set(survey.id, 6).set(survey.name, "6").addBatch();
        assertEquals(2, insert.execute());
    }

Changed in querydsl:
status: In Progress → Fix Committed

Released in 1.9.1

Changed in querydsl:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers