1 Reply Latest reply on Jun 29, 2006 10:14 PM by Chris Malan

    EJBQL help

    wei zhang Newbie

      there are parent/child tables in the persist level of my app.

      I am trying to use EJBQL to update the child table, link one row to the parent

      something like this:

      q = em.createQuery("update child c set c.parent = :PAR where c.id=1");
      q.setParameter("PAR", parent);

      here parent is a exsisting detached parent instance.

      I got "DML not supported" error. anyone can help me? I am really a SQL beginer.

      thanks a lot.

        • 1. Re: EJBQL help
          Chris Malan Novice

          Heaven knows what DML is. However, it sounds as if it a feature not supported for your query to be effective. Your query looks fine to me.

          To do the same you can use the entity manger to return the child object with id 1 and then do child.setParent(parent);