1 Reply Latest reply on Nov 1, 2003 2:29 PM by juha

    Unidirectional 1:M CMR problems

    gorano

      I have no problems constructing CMRs apart from unidirectional one to many. I am trying to use the XDoclet below but JBoss error is:
      Both roles of a relation-table mapped relationship must have key fields

      Do I really need a relation table for CMRs or do I miss something in my XDoclet? With plain SQL I dont need any relation tables to make a Unidirectional 1:M.

      /**
      * @ejb.interface-method
      * view-type="local"
      *
      * @ejb.relation
      * name="ServiceDetail-Security"
      * role-name = "one-ServiceDetail-has-many-Security"
      * target-role-name="one-Security-belongs-to-one-ServiceDetail"
      * target-ejb = "Security"
      * target-multiple="yes"
      *
      * @jboss.target-relation
      * related-pk-field = "serviceId"
      * fk-column = "SERVICE_ID"
      */
      public abstract java.util.Collection getSecurities();

      Thanks

      Goran