Re: How to use RelationshipQuery?

From: Andrus Adamchik (andru..bjectstyle.org)
Date: Fri Oct 13 2006 - 09:58:05 EDT

  • Next message: DOMINGUEZ Felipe: "Still problems to create Ant task"

    Hi Arturo,

    Not quite sure what problem you are trying to solve, but I can
    comment on RelationshipQuery. RelationshipQuery is used by Cayenne
    internally to resolve relationships. Applications rarely create it
    directly, but there is no problem if you do:

    http://cwiki.apache.org/CAYDOC/relationshipquery.html

    Ignore the EntityResolver methods, as those are just callbacks that
    are invoked by Cayenne when the query is executed. Just for the
    reference, EntityResolver is a logical analog of EOF EOModelGroup -
    it provides a single combined namespace for mapping metadata and is
    accessible via ObjectContext|DataContext.getEntityResolver().

    Andrus

    On Oct 12, 2006, at 11:58 PM, Arturo Pérez wrote:
    > Hi all,
    >
    > I was trying to populate some Click CayenneForm things. Coming
    > from an
    > EOF world, I prefer to traverse relationships rather than run queries.
    > But many (all?) of the Click Cayenne integrations require
    > SelectQuery to
    > function. In looking around for a way to bridge this divide, I
    > stumbled
    > across the RelationshipQuery thing in Cayenne 1.2. But I couldn't
    > figure out how to use it. What's an EntityResolver? How do I get
    > one?
    > How do I convert a RelationshipQuery into a SelectQuery? Is this
    > even a
    > sensible way to approach the problem?
    >
    > An example use of the RelationshipQuery or a better suggestion
    > would be
    > much appreciated,
    >
    > tia,
    > arturo
    >
    >



    This archive was generated by hypermail 2.0.0 : Fri Oct 13 2006 - 09:58:28 EDT