1 Reply Latest reply on May 21, 2002 2:59 PM by bjoern

    CMR-Field Problem

    bjoern Newbie

      Hi all!

      I have a problem using the accsessors for CMR fields.

      I created 2 Entity (entity1 & entity2)Beans with local interfaces. Between this two Beans is a 1:N relationship with foreign key mapping. Using the getRealtion() CMR-Field accsessor gives me the depandent ENTITY2 Bean back.

      Creating a new ENTITY1 Bean with also a new ENTITY2 Bean writes also correct the PrimaryKey of ENTITY2 in the ForeignKey Field of ENTITY1 at the datasource.

      The problem is now to create a new ENTITY1 Bean with an existing ENTITY2 Bean. I wrote a ejbSelect methode to search for the ENTITY2 bean by PrimaryKey. The methode serves the correct bean local interfaces but when using the setRelation(Entity2Local en) CMR-Accsessor JBOSS did not write the PrimaryKey of ENTITY2 into the ForeignKey field of ENTITY1. It wrotes all not CMR-Fields into the database.

      I attached the sourcecode of entity1.

      Does anybody knows what goes wrong in the code. JBOSS did not throw any exception or messages.