Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[eclipselink-users] DeleteAllQuery selectionCriteria ignored?


Hi.

Why does this code:

public void deleteEntityDefects(final ChangeObject entity) {
        DeleteAllQuery query = new DeleteAllQuery(Defect.class);
        ExpressionBuilder selectionCriteria = query.getExpressionBuilder();
        selectionCriteria.anyOf("causedBy").get("referenceId").equal(entity.getObjectId());
        query.setSelectionCriteria(selectionCriteria);
        query.setShouldDeferExecutionInUOW(false);
        this.entityManager.getActiveSession().executeQuery(query);
    }

produce this sql:

DELETE FROM DEFECT_REFERENCE WHERE EXISTS(SELECT ID FROM DEFECT WHERE ID = DEFECT_REFERENCE.Defect_ID)

DELETE FROM DEFECT

It seems as if the selectionCriteria is being ignored?

 /Magnus Heino

Back to the top