2 Replies Latest reply: Mar 24, 2011 2:57 PM by Patrick Devine RSS

    Cannot Change Entity Containment to Global

    Patrick Devine
      Hello,

      I'm encountering a problem with entity containment relationships and I'm wondering if anyone can help. Briefly, I cannot seem to switch "Containing entity" back to Global once I've chosen that entity to be contained by another entity (i.e. other than Global). In other words, I need a way to undo the decision to put an entity underneath another entity.

      For example, assuming I have two entities, A and B, both of which are initially contained by the Global.

      Step 1. Make A contained by B, i.e. a "child" entity of B.
      Step 2. Make A contained by the Global again (i.e. reverse Step 1).

      When I try to accomplish Step 2, I:

      - Click the "..." button beside "Containing entity"
      - Click on Global
      - Click OK
      - Containing entity does not change, as if the choice of Global was not recognized.

      Any ideas?

      Thanks,
      - Patrick
        • 1. Re: Cannot Change Entity Containment to Global
          Andrew Barry
          Patrick,

          Yep, looks like I can't switch them either. I'm unsure if it's a regression or if it's been broken since containment was added - I'll need to do deeper analysis.

          If you're confident editing XML with a text editor, then it's fairly straightforward to directly fix.

          Open your properties file in a text editor such as notepad (after taking a backup of the file in case you mess it up).

          Firstly you need to change the <entity> declaration for A.

          It'll look something like:

          <entity id="A" name="the A" containment-relationship-id="ays" containment-parent-id="B" />

          you need to change the containment-parent-id attribute value to "global"

          ie:
          <entity id="A" name="the A" containment-relationship-id="ays" containment-parent-id="global" />

          You also need to amend change the containment relationship declaration (near the bottom of the file):

          <relationship source="B" target="A" is-containment="true" public-id="" reverse-public-id="" text="the ays" relationship-id="ays" reverse-text="" reverse-relationship-id="A_B_rev" type="OneToMany" is-computed="false" />

          For this line, you need to change the source attribute to also be "global"

          ie:
          <relationship source="global" target="A" is-containment="true" public-id="" reverse-public-id="" text="the ays" relationship-id="ays" reverse-text="" reverse-relationship-id="A_B_rev" type="OneToMany" is-computed="false" />

          Save your changes, open in Studio and everything should be fine.

          Or failing that (and/or if you aren't confident making the changes) feel free to send the properties file to me at: andrew DOT barry AT oracle DOT com and I'll be happy to fix it for you.

          Regards

          Andrew
          • 2. Re: Cannot Change Entity Containment to Global
            Patrick Devine
            Great. Thanks, Andrew. I performed those edits and things seem to be back to normal.