JPA: bulk delete queries must use DELETE FROM

Bug #783298 reported by Maia Everett on 2011-05-16
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Querydsl
Fix Released
Undecided
Unassigned

Bug Description

org.apache.openjpa.persistence.ArgumentException: "Encountered "User" at character 8, but expected: ["FROM"]." while parsing JPQL "delete User user where user.role = :a1".

The DELETE serialization follows now the JPQL standard :

    @Test
    public void Delete_Clause_Uses_DELETE_FROM() {
        JPQLSerializer serializer = new JPQLSerializer(HQLTemplates.DEFAULT);
        QueryMetadata md = new DefaultQueryMetadata();
        md.addJoin(JoinType.DEFAULT, QEmployee.employee);
        md.addWhere(QEmployee.employee.lastName.isNull());
        serializer.serializeForDelete(md);
        assertEquals("delete from Employee employee\nwhere employee.lastName is null", serializer.toString());
    }

Changed in querydsl:
status: New → Fix Committed

Released in 2.2.0.beta5

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