Re: Parenthesis in queries.

From: Andrus Adamchik (andru..bjectstyle.org)
Date: Thu Jul 07 2005 - 03:43:47 EDT

  • Next message: Andrus Adamchik: "Re: SelectQuery and table that is synonym"

    > I don't really understand the difference between SelectQueries and
    > SQLTemplateQueries (as far as how they handle syntax)

    Yes, there is a difference. SQLTemplate is an unparsable "black box"
    to Cayenne, while SelectQuery is not (see below).

    > it seems that if I could get the same expression into the
    > SelectQuery, that it would work fine. Is this true, or is there
    > some formatting thing in the SelectQuery that would throw it off.

    Cayenne expressions have dual functionality - they can be applied to
    object graphs in-memory, and they can also be translated to SQL WHERE
    clause by Cayenne. The scope of what expressions can and can not do
    is formally defined by this syntax - http://objectstyle.org/cayenne/
    grammar/ExpressionParser.html

    This means that each element in the expression string has to mean
    something to Cayenne. Unlike SQLTemplate, Expression is not a "black
    box". It has to be parseable into something that Cayenne understands.
    So this is not a matter of parenthesis per se (parenthesis are
    supported for grouping), the problem is that with this you introduce
    a new element - functions - that are not currently a part of the
    official syntax.

    I hope this makes sense.

    Andrus



    This archive was generated by hypermail 2.0.0 : Thu Jul 07 2005 - 03:43:51 EDT