Re: SQLTemplate / inExp

From: Andrus Adamchik (andru..bjectstyle.org)
Date: Mon Feb 06 2006 - 19:45:30 EST

  • Next message: Andrus Adamchik: "Re: dataObject.writeProperty and validation of a new dataObject"

    I wouldn't be surprised. But then this is SQLTemplate we are talking
    about, and Cayenne shouldn't try to second-guess the user. Any better
    ideas?

    Andrus

    On Feb 6, 2006, at 7:26 PM, Joshua Pyle wrote:

    > Some Databases have size limits for the IN statement
    >
    > --
    > Joshua T. Pyle
    > Go has always existed.
    >
    >
    > On 2/6/06, Cris Daniluk <cris.danilu..mail.com> wrote:
    >> I'm experimenting with a patch I created to do just that.
    >> Hopefully it works :)
    >>
    >> On 2/6/06, Andrus Adamchik <andru..bjectstyle.org> wrote:
    >>> For now Velocity #foreach is your friend.
    >>>
    >>> Also I would happily commit a patch to the
    >>> org.objectstyle.cayenne.access.jdbc.BindDirective that would
    >>> internally expand a list of objects the the comma-separated
    >>> syntax :-)
    >>>
    >>> So that you could write "WHERE field IN (#bind($list CHAR))"
    >>>
    >>> Andrus
    >>>
    >>>
    >>> On Feb 6, 2006, at 3:43 PM, Cris Daniluk wrote:
    >>>
    >>>> Apologies if I've overlooked something simple, but for the life
    >>>> of me
    >>>> I can't figure out how to bind a list to a query using something
    >>>> like
    >>>> #bind().
    >>>>
    >>>> I'd basically like to do a simple IN query:
    >>>>
    >>>> SELECT * FROM table WHERE field IN ($list)
    >>>>
    >>>> It doesn't seem like SQLTemplateProcessor and BindDirective
    >>>> support it
    >>>> now, but it seems like it could by simply detecting Collection and
    >>>> making a few simple changes to the query output.
    >>>>
    >>>> Is there another way?
    >>>>
    >>>> Cris
    >>>>
    >>>
    >>>
    >>
    >



    This archive was generated by hypermail 2.0.0 : Mon Feb 06 2006 - 19:45:33 EST