0 Replies Latest reply on Sep 17, 2002 8:19 AM by joepjanssen

    Foreign key mapping

    joepjanssen

      Using JBoss-3.0.0 with Oracle 8i

      I'm trying to map a 1-n relation. All goes well with the jbosscmp-jdbc.xml file (the correct foreign key fields are created), but I cannot get it mapped to my entity bean.

      In the UserBean (which has 1 Group)
      public abstract Group getUsergroup() throws RemoteException;
      public abstract void setUserGroup() throws RemoteException;

      in the ejb-jar.xml:

      <ejb-relation>
      <ejb-relation-name>
      UserBeanToGroupBean
      </ejb-relation-name>
      <ejb-relationship-role>
      <ejb-relationship-role-name>
      UserBelongsToGroup
      </ejb-relationship-role-name>
      Many
      <relationship-role-source>
      <ejb-name>UserBean</ejb-name>
      </relationship-role-source>
      <cmr-field>
      <cmr-field-name>
      usergroup
      </cmr-field-name>
      </cmr-field>
      </ejb-relationship-role>
      <ejb-relationship-role>
      <ejb-relationship-role-name>
      UsersInGroup
      </ejb-relationship-role-name>
      One
      <relationship-role-source>
      <ejb-name>GroupBean</ejb-name>
      </relationship-role-source>
      <cmr-field>
      <cmr-field-name>users</cmr-field-name>
      <cmr-field-type>
      java.util.Collection
      </cmr-field-type>
      </cmr-field>
      </ejb-relationship-role>
      </ejb-relation>


      The ERROR that I keep getting:

      javax.ejb.EJBException: Method is not a known CMP field accessor, CMR field accessor, or ejbSelect method: methodName=setUsergroup;

      Anyone?