Re: Namespaces for db and obj relationships

From: Andrus Adamchik (andru..bjectstyle.org)
Date: Wed Jul 16 2003 - 17:20:32 EDT

  • Next message: Patrick Whalen: "Getting started with Cayenne & Frontbase"

    Hi Michael,

    Relationship names don't have to be globally unique. They have entity
    scope (and DB and OBJ are independent from each other).

    In fact I often take advantage of relationships with the same name that
    belong to different entities. This is one of my favorite patterns. It
    allows cool things like reusing a qualifier expression across entities
    (e.g. a set of unrelated entities all have relationship "toAddress",
    similar to your example).

    Andrus

    > Andrus:
    >
    > Out of curiousity, do the names of db-relationships and
    > obj-relationships have to be globally unique within a map file?
    >
    > I have a few cases with relations named toRace where the ids are the
    > same race_id to race_id, but the table names change based on the
    > source/dest.
    >
    > I can easily rename things, but going forward, what is the best practice
    > when there are similar relations in different tables or objects
    > (source_dest)?
    >
    > -MA



    This archive was generated by hypermail 2.0.0 : Wed Jul 16 2003 - 17:20:33 EDT