Re: delete from ... where ... in (...)

From: Andrus Adamchik (andru..bjectstyle.org)
Date: Fri May 30 2008 - 10:13:43 EDT

  • Next message: Jon Sharp: "Re: Cayenne and JAX-WS / JAXB / GWT"

    Don't remember off-hand (this was certainly possible with Cayenne
    'classic' expressions). Could you give it a try?

    Andrus

    On May 30, 2008, at 4:53 PM, Borut Bolčina wrote:

    > Hi,
    >
    > EJBQLQuery delete = new EJBQLQuery("delete from Artist a where a.id
    > in (1,
    >> 2, 3)");
    >
    >
    > this looks more promising. It would be better this way (IMHO):
    >
    > context = // assume this exists
    > List<Integer> myArtistList = // assume this exists
    > EJBQLQuery delete = new EJBQLQuery("delete from Artist a where a.id in
    > :myArtistList");
    > delete.setParameter("myArtistList", myArtistList);
    > context.performNonSelectingQuery(deleteQuery);
    >
    > Is this possible? Or, would it be?
    >
    > Thanks,
    > Borut
    >
    > 2008/5/30 Andrus Adamchik <andru..bjectstyle.org>:
    >
    >> See my other reply - there is actually an EJBQL delete.
    >>
    >>
    >>
    >> On May 30, 2008, at 4:27 PM, Borut Bolčina wrote:
    >>
    >> Hi,
    >>>
    >>> what is the C3M4 prefered way of doing this SQL equivalent: DELETE
    >>> FROM
    >>> Artist WHERE Oid IN (1,4,8,9);
    >>>
    >>> Thanks,
    >>> Borut
    >>>
    >>
    >>



    This archive was generated by hypermail 2.0.0 : Fri May 30 2008 - 10:14:21 EDT