3 Replies Latest reply on Jul 31, 2002 7:19 PM by Wesley Hall

    CMR Relation-Table generates strange table names.

    Wesley Hall Newbie

      Hi all,
      I am trying to do some CMR relation table mapping. I believe i have correctly specified the required values in jbosscmp-jdbc.xml but when i depoly my ejb jar the relation tables are being given bizare names such as...

      "team_projectmanager_tea_1msskyy"

      Could anyone tell me why Jboss is ignoring my <table-name> element and creating these strange tables for the CMR mapping?

      Thank you

        • 1. Re: CMR Relation-Table generates strange table names.
          Tung Dang Novice

          Your information are not enough to find out the problem. I recommend you to post your configuration files on the forum so that we can see where the problem really is.

          • 2. Re: CMR Relation-Table generates strange table names.
            Wesley Hall Newbie

            Ok here are the sections of the files, JBoss seems to create its own table name and not use mine...

            In ejb-jar.xml

            <ejb-relation>
            <ejb-relation-name>Project-ProjectManager</ejb-relation-name>
            <ejb-relationship-role>
            <ejb-relationship-role-name>Project-Has-ProjectManager</ejb-relationship-role-name>
            One
            <relationship-role-source>
            <ejb-name>Team</ejb-name>
            </relationship-role-source>
            <cmr-field>
            <cmr-field-name>projectManager</cmr-field-name>
            </cmr-field>
            </ejb-relationship-role>
            <ejb-relationship-role>
            <ejb-relationship-role-name>ProjectManager-Has-Project</ejb-relationship-role-name>
            One
            <relationship-role-source>
            <ejb-name>TeamMember</ejb-name>
            </relationship-role-source>
            </ejb-relationship-role>
            </ejb-relation>

            In jbosscmp-jdbc.xml

            <ejb-relation>
            <ejb-relation-name>Project-ProjectManager</ejb-relation-name>
            <table-mapping>
            <table-name>PROJECT_PROJECTMANAGER_LINK</table-name>
            <create-table>true</create-table>
            <remove-table>false</remove-table>
            <ejb-relationship-role>
            <ejb-relationship-role-name>Project-Has-ProjectManager</ejb-relationship-role-name>
            <table-key-fields>
            <field-name>projectID</field-name>
            <column-name>PROJECT</column-name>
            </table-key-fields>
            </ejb-relationship-role>
            <ejb-relationship-role>
            <ejb-relationship-role-name>ProjectManager-Has-Project</ejb-relationship-role-name>
            <table-key-fields>
            <field-name>teamMemberID</field-name>
            <column-name>TEAM_MEMBER</column-name>
            </table-key-fields>
            </ejb-relationship-role>
            </table-mapping>
            </ejb-relation>

            • 3. Re: CMR Relation-Table generates strange table names.
              Wesley Hall Newbie

              Never mind,
              I checked my jbosscmp-jdbc.xml against the dtd and found some errors, everything works now. You guys might wanna update the cmp part of the jboss book, the example doesnt match the dtd!