Re: split expressions

From: Aristedes Maniatis (ar..aniatis.org)
Date: Wed Jan 13 2010 - 05:45:10 EST

  • Next message: Andrus Adamchik: "Re: split expressions"

    On 13/01/10 8:53 PM, Andrus Adamchik wrote:
    >> That is, you might combine expressions with:
    >>
    >> exp1.and(exp2, Expression.SPLIT_PATH)
    >> exp1.and(exp2, Expression.MERGE_PATH)
    >> exp1.and(exp2)
    >
    > I don't understand how the second argument is applicable in the context
    > of "and"? Anyways,

    Split paths can already be added to the Path with "|" in some circumstances. They can be added to the Expression with matchAll(). And in this case, they are deeply relevant to the AND because that's what the developer cares about. Do they get zero results when searching across a many join (which you always do with ANDed expressions and no split path)? Merging the path is never useful when you are ANDing two expressions.

    > Thinking about
    > it, it may be helpful to allow attaching aliases to path expressions
    > after the fact in Cayenne. I.e. define aliases during the query assembly
    > stage. Something to think about for 3.1.

    It seems that aliases (used in this way) are merely a workaround to the fact that Expressions need to know whether they should have their paths combined or not.

    > Actually I think I see what you mean here. Unfortunately this will only
    > work for joining simple key/value expression, but won't work when
    > joining more complex expressions that have more than one key/value pair.

    It is not immediately obvious to me why not. I guess I tend to think of Path == Expression, since I always always create expressions using matchExp() and friends. But what happens now if you AND an expression created with matchAll with another expression with an overlapping path?

    Ari

    -- 
    -------------------------->
    Aristedes Maniatis
    GPG fingerprint CBFB 84B4 738D 4E87 5E5C  5EFA EF6A 7D2E 3E49 102A
    



    This archive was generated by hypermail 2.0.0 : Wed Jan 13 2010 - 05:45:55 EST