Re: Expression w/ pathSpec<operator>pathSpec - ??

From: Matt Kerr (mat..entralparksoftware.com)
Date: Thu Apr 15 2004 - 10:40:49 EDT

  • Next message: Mike Kienenberger: "Re: Expression w/ pathSpec<operator>pathSpec - ??"

    my bad #2 ... hahaha - i see your overwritten method now ... (eyes open)

    so myColumnB is pathSpec in that implementation ...

    i will still ask though

    > ps. what does AST stand for again?

    thanks!!

    On Apr 15, 2004, at 10:39, Matt Kerr wrote:

    > my bad - i am using cayenne-1.1M4
    >
    > > public ASTNotEqual(ASTPath path, Object value)
    >
    > looks interesting, but is 'myColumnB' a "value" or a "pathSpec" - ?
    >
    > ps. what does AST stand for again?
    > thanks-matt
    >
    >
    >
    > On Apr 15, 2004, at 10:22, Mike Kienenberger wrote:
    >
    >> Matt Kerr <mat..entralparksoftware.com> wrote:
    >>> what's the cayenne magic to perform query like ...
    >>>
    >>> mysql> select * from MyTable where myColumnA != myColumnB;
    >>>
    >>>
    >>> all the ExpressionFactory methods i see are pathSpec<operator>value
    >>> but no pathSpec<operator>pathSpec - ?
    >>
    >> In the 1.1 head, matchNotExp() calls this:
    >>
    >> return new ASTNotEqual(new ASTObjPath(pathSpec), value);
    >>
    >> public ASTNotEqual(ASTPath path, Object value) {
    >> super(ExpressionParserTreeConstants.JJTNOTEQUAL);
    >> jjtAddChild(path, 0);
    >> jjtAddChild(new ASTScalar(value), 1);
    >> }
    >>
    >> One thing you could do is patch or subclass ASTNotEqual to create
    >> something
    >> like
    >>
    >> public ASTNotEqual(String pathSpec1, String pathSpec2) {
    >> super(ExpressionParserTreeConstants.JJTNOTEQUAL);
    >> jjtAddChild(new ASTObjPath(pathSpec1), 0);
    >> jjtAddChild(new ASTObjPath(pathSpec2), 0); // maybe ", 1)"
    >> instead?
    >> }
    >>
    >> but I don't know if there's an easier solution using the new
    >> expressions in
    >> 1.1.
    >>
    >> If you're using 1.0, you need to investigate following a similar
    >> process
    >> since I suspect the expression-handling in 1.0 is completely
    >> different.
    >>
    >



    This archive was generated by hypermail 2.0.0 : Thu Apr 15 2004 - 10:41:03 EDT