Is it possible to compare entity keys in an object query?

From: Travis Cripps (travi..pparentmotion.com)
Date: Thu Dec 09 2004 - 19:31:24 EST

  • Next message: Jürgen Saar: "Re: How to model many-to-many relationship with self?"

    Hi. I've been working with Cayenne for about a week. So far, I've
    found it to be pretty nice.

    After looking through the documentation and trying to experiment in
    CayenneModeler, I've been unable to create a query that will compare a
    key from one entity with a value from a related entity by traversing
    the relationship.

    Here's a simple example:

    Imagine my simple model is:

    Person (Entity)
    pk id
            name

    Pet (Entity)
    pk id
    fk owner_id
            name
            owner (to-one relationship with person)

    What I'd like to do is build a query like:

    Query Name: PetHasSameNameAsOwnerQuery
    Query Root: Pet
    Qualifier: name caseInsensitiveLike owner.name

    Is this possible in Cayenne? How would I represent that either in
    CayenneModeler or in an Expression? I'd really appreciate the help.

    Thank you very much!

    Travis



    This archive was generated by hypermail 2.0.0 : Thu Dec 09 2004 - 19:31:03 EST