R: Unable to build the right expression

From: Claudio Rosati (claudio.rosat..csys.it)
Date: Wed Aug 25 2004 - 03:32:06 EDT

  • Next message: Tore Halset: "Re: R: Unable to build the right expression"

    OK, but how can I query for nodes without leaves? The following expression
    will work
      exp = exp.andExp(ExpressionFactory.matchExp("variantForms", null)) (I
    think no, because being "variantForms" a List mapping a to-many relation, ti
    will be always non-null but, eventually, empty).

    CLaudio

    ------------------------------------
    Advanced Computer Systems S.p.A.
    Claudio Rosati
    Project Manager
    claudio.rosat..csys.it
    via Della Bufalotta 378
    00139 Roma, RM
    Italy
    tel: +39 06 8709 0516
    fax: +39 06 8720 1502
    ------------------------------------
     

    > -----Messaggio originale-----
    > Da: Tore Halset [mailto:halse..vv.ntnu.no]
    > Inviato: marted́ 24 agosto 2004 20.56
    > A: Cayenne mailing list post
    > Oggetto: Re: Unable to build the right expression
    >
    > On Aug 24, 2004, at 15:52, Claudio Rosati wrote:
    >
    > > Expression exp = ExpressionFactory.likeIgnoreCaseExp("name", "%" +
    > > stext + "%"); exp =
    > >
    > exp.orExp(ExpressionFactory.likeIgnoreCaseExp("variantForms.name", "%"
    > > + stext + "%"));
    > > exp = exp.andExp(ExpressionFactory.matchExp("approved",
    > > Boolean.TRUE));
    >
    > As you have experienced this will exclude the nodes that does
    > not have any leaf nodes.
    >
    > It is not the most elegant solution, but are you able to
    > split this up into two queries? One for nodes containing
    > stext and another query for nodes that has a leaf that contains stext.
    >
    > Regards,
    > - Tore.



    This archive was generated by hypermail 2.0.0 : Wed Aug 25 2004 - 03:32:02 EDT