Cayenne
  1. Cayenne
  2. CAY-324

Refactoring of object hierarchies causes relationship problems

    Details

    • Type: Bug Bug
    • Status: Open
    • Priority: Major Major
    • Resolution: Unresolved
    • Affects Version/s: 1.2 branch
    • Fix Version/s: None
    • Component/s: Modeler
    • Labels:
      None
    • Environment:
      Debian Sid Linux, java 1.4.2_01

      Description

      When performing refactoring of object hierarchies in the modeling, problems with inherited relationships can arise where the child object and the parent object both define the relationships (in the mapping xml file), even though it looks like the child is correctly inheriting the relationship in the modeler.

      Scenarios where this behavior has been observed:
      Create a "base" object from a table and synchronize with the database.
      Now select the database entity and click on the "create object entity" button; the modeler will automatically select the table, etc. for you, synchronized with the database.
      This second object should extend the first object, so change the inheritence to reflect this. Save the project and look at the mapping; all of the relationships and attributes will be defined twice, once in the base and once in the sub class. Expected: since all of the attributes and relationships in the class are inherited, the subclass shouldn't redefine them; since they were already defined in the object before making it the subcass of the first object, the inherited subclass attributes and relationships should be deleted.

      Another way:
      Create the base class (A). Don't synch; it's an empty object.
      Create a subclass (B) and synchronize the object. The attributes and relationships are correctly added.
      Now go back and synchronize A with the database. The attributes and relationships are, once again, correctly added. But, if you look back at B, it appears as though all of the attributes and relationships are being inherited from A, when, in fact, the map will show them defined both places. When the base class adds a property or relationship that exists in a subclass, as long as the properties or relationships are exactly the same, the subclass property/relationship should be removed in the graph.

        Activity

        Robert Zeigler created issue -
        Henri Yandell made changes -
        Field Original Value New Value
        Project Import Sat Mar 21 00:51:04 PDT 2009 [ 1237621864637 ]
        Ari Maniatis made changes -
        Workflow jira [ 12456821 ] Cayenne workflow [ 12487516 ]

          People

          • Assignee:
            Andrus Adamchik
            Reporter:
            Robert Zeigler
          • Votes:
            1 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:

              Development