1 Reply Latest reply on Nov 14, 2002 1:07 PM by jboynes

    same field as CMP and CMR

    selva_mp

      Hi,
      I am from India, trying to port our enterprise application from WebLogic 7.0 to JBoss 3.0.2.
      We are almost done with the porting, but we are currently running out of a problem. Hope u will be able to clear our doubts.

      Our problem is,

      We are not able to use the same field as both CMR and CMP field.
      For example,
      we have an entity A which has a one to many relationship with another entity bean B.
      Entity A has a CMP field called KEY which is the primary key of Entity A.
      This field KEY exists as a foreign key in entity bean B.
      Entity bean B also has a CMP field for KEY.

      A one to many relationship is specified between entity A and entity B with a CMR field in entity bean B, returning the entity A.
      Under this situation, the SQL generated by JBoss contains "two" columns named KEY(one for CMR field and another for CMP field).

      We were able to get around this problem only by using either CMR or CMP for a particular field.

      So the basic question is ====>
      Does JBoss support the usage of the same field for CMP and CMR field? Using the same field as CMR and CMP works fine in WebLogic 7.0.


      Awaiting your reply,

      Thanx and regards

        • 1. Re: same field as CMP and CMR
          jboynes

          It doesn't make sense to have two fields refer to the same physical column. By defining both CMP and CMR fields that's what you're trying to do.

          Pick one or the other - the CMR field is probably more useful.

          There are several other posts on this subject as well.