0

I'm using JPA Criteria API, and I want to remove "Actions" that have "Loop" is equal to the passed param, so I did as following:

public void removeByLoopId(final Long id) {
    CriteriaBuilder cb = getEntityManager().getCriteriaBuilder();
    CriteriaDelete<Action> delete = cb.createCriteriaDelete(Action.class);
    Root<Action> root = delete.from(Action.class);
    delete.where(cb.equal(root.get(Action.actor).get(Actor_.step).get(Step_.loop).get(Loop_.id), id));
    getEntityManager().createQuery(delete).executeUpdate();
}

But I'm getting this exception :

ERROR o.h.e.j.s.SqlExceptionHelper - ORA-00933: SQL command not properly ended

How can I solve this ?

Edit:

This is the generated SQL query:

delete
    from
        IKURUSAKI.Action cross
    join
        IKURUSAKI.Actor cross
    join
        IKURUSAKI.Step cross
    join
        IKURUSAKI.Loop 
    where
        id=10738;
Community
  • 1
  • 1
Renaud is Not Bill Gates
  • 1,684
  • 34
  • 105
  • 191

0 Answers0