Re: Expression chains

From: Mike Kienenberger (mkienen..laska.net)
Date: Wed Feb 16 2005 - 17:03:27 EST

  • Next message: Cris Daniluk: "RE: Expression chains"

    Cris Daniluk <cris.danilu..laraview.com> wrote:
    > Not sure if I've brought this up here yet or not, but I think it would be
    > handy to extend ExpressionFactory to accept parameters like this:
    >
    > ExpressionFactory.matchExp(new String[] { "toPainting", "toArtist",
    > "artistName" }, "Monet")
    >
    > As an alternative to:
    >
    > ExpressionFactory.matchExp("toPainting.toArtist.artistName", "Monet");
    >
    > The reason for this is that we do not use the literal references to
    > relationships, but rather the constants exposed by Cayenne in the
    > DataObjects:
    >
    >
    ExpressionFactory.matchExp(MUSEUM.TO_PAINTING_PROPERTY+"."+PAINTING.TO_ARTIS
    > T_PROPERTY+"."+ARTIST.ARTIST_NAME_PROPERTY, "Monet");

    import org.apache.commons.lang.StringUtils; // cayenne dependency

    ExpressionFactory.matchExp(StringUtils.join(String[] {
    MUSEUM.TO_PAINTING_PROPERTY, PAINTING.TO_ARTIST_PROPERTY,
    ARTIST.ARTIST_NAME_PROPERTY }, '.'), "Monet");



    This archive was generated by hypermail 2.0.0 : Wed Feb 16 2005 - 17:02:44 EST