2 Replies Latest reply on Jul 23, 2003 11:40 AM by sys user

    CMR deploy error

    Matthieu Chase Heimer Newbie

      I've got a one-to-many unidirectional relationship that I'm trying to setup with JBOSS 3.2.1 that isn't working. The one unnormal thing that I have is that it's the same bean on both sides of the relationship.

      Do I have something wrong with my syntax or can JBOSS just not handle this?

      ----from my ejb-jar.xml----

      <ejb-relation>
      <ejb-relation-name>Message-Message</ejb-relation-name>
      <ejb-relationship-role>
      <ejb-relationship-role-name>Message</ejb-relationship-role-name>
      One
      <relationship-role-source>
      <ejb-name>Message</ejb-name>
      </relationship-role-source>
      <cmr-field>
      <cmr-field-name>responses</cmr-field-name>
      <cmr-field-type>java.util.Set</cmr-field-type>
      </cmr-field>
      </ejb-relationship-role>
      <ejb-relationship-role>
      <ejb-relationship-role-name>Message_2</ejb-relationship-role-name>
      Many
      <cascade-delete/>
      <relationship-role-source>
      <ejb-name>Message</ejb-name>
      </relationship-role-source>
      </ejb-relationship-role>
      </ejb-relation>

      ----from my standardjbosscmp-jdbc.xml----

      <ejb-relation>
      <ejb-relation-name>Message-Message</ejb-relation-name>
      <foreign-key-mapping/>
      <ejb-relationship-role>
      <ejb-relationship-role-name>Message</ejb-relationship-role-name>
      <key-fields>
      <key-field>
      <field-name>id</field-name>
      <column-name>parent_id</column-name>
      </key-field>
      </key-fields>
      </ejb-relationship-role>
      <ejb-relationship-role>
      <ejb-relationship-role-name>Message_2</ejb-relationship-role-name>
      </ejb-relationship-role>
      </ejb-relation>

        • 1. Re: CMR deploy error
          Matthieu Chase Heimer Newbie

          Ok, got it working. I was mistaken about which relationship was causing the problem.

          I had a couple one-many bidirectional relationships and they were causing the problem.

          But I still have almost the same question- JBoss docs say that it can handle one-many relationships using foreign keys but I had to use relation tables to get JBoss to stop complaining. Can JBoss not handle a BIDIRECTIONAL one-many mapping with foreign keys or is my syntax probably just wrong?

          • 2. Re: CMR deploy error
            sys user Master

            Can u send the code zip of working 1 to many relationship.
            I have a werid problem where it is working for me but i am retunred the exact no of rows but with the same data. Say DB has 3 rows then i get 3 rows with same data.

            Can you attach me ur zips or atleat XMLs

            Thanks