0 Replies Latest reply on Jan 23, 2003 7:26 AM by Nir Oren

    many to many relation table

    Nir Oren Newbie

      Hey...

      I've got a class with the following xdoclet and java code:

      /**@ejb:relation name="role-has-other-roles"
      * role-name="role-contains"
      * cascade-delete="no"
      * @jboss:table-relation table-name="rolerolecontents"
      * @jboss:relation related-pk-field="roleID" fk-column="parentrole"
      */
      public abstract Collection getChildRoles();
      public abstract void setChildRoles(Collection cr);


      /** @ejb:relation name="role-has-other-roles"
      * role-name="contents-of-role"
      * cascade-delete="no"
      * @jboss:table-relation table-name="rolerolecontents"
      * @jboss:relation related-pk-field="roleID" fk-column="chilldrole"
      */
      public abstract Collection getParentRoles();
      public abstract void setParentRoles(Collection cr);

      When I start up JBoss, it creates a table named role_childroles_role_parentrole instead of the rolerolecontents name that I really wanted it to have. Furthermore, unlike other tables (which just give a warning), JBoss throws an exception if I start it up after the table has already been created. Is there any way to get around this problem? The table contains some very useful data, so dropping it every time I kill the server is not an option.
      Thanks
      Nir