JPA: bulk delete queries must use DELETE FROM

Bug #783298 reported by Maia Everett
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".

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

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
Revision history for this message
Timo Westkämper (timo-westkamper) wrote :

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  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.