3 Replies Latest reply on May 30, 2002 4:39 PM by tafypz

    Jboss 3.0 RC3 CMR problem

    tafypz

      Hi,
      I was wondering if any body experienced any problem using CMP 2.0 Entities and CMR relationship.

      I have run my code on weblogic 6.1 and it is working fine, so there is nothing wrong with the code itself.
      So my guess is that i do something wrong in my deployment descriptors (they are in attachment).

      I have a CMR field called "department" (defined in ejb-jar.xml).
      I have 2 Entities Employee and Department with a 1:N relation.

      Employee Entity has methods getDepartment and setDepartment, these methods take and return a department Entity.

      So the CMR field is an entity bean and not a field in db.

      Everything deploys well but when i want to get data from my DB using my entity i have this exception :
      Column not found: Unknown column 'department' in 'field list'

      I modified a lot my jbosscmp-jdbc.xml but I get always the same exception.

      If anybody know how to work this out please let me know

      Thanks a lot
      Sebastien

        • 1. Re: Jboss 3.0 RC3 CMR problem
          tafypz

           

          "tafypz" wrote:
          Here are the files


          • 2. Re: Jboss 3.0 RC3 CMR problem
            prabha

            I had a similar problem. It is working now. The key-field in "EmployeeIsInDepartment" is not required in jbosscmp-jdbc.xml, It should be something like:

            <ejb-relationship-role-name>EmployeeIsInDepartment</ejb-relationship-role-name>
            - <!-- multiplicity many using foreign-key mapping is not allowed to have key-fields
            -->
            <fk-constraint>true</fk-constraint>
            <key-fields>
            </key-fields>
            <read-ahead>
            on-load
            <page-size>1000</page-size>
            <eager-load-group>*</eager-load-group>
            </read-ahead>


            Try this, it will get rid of invalid column name error.

            • 3. Re: Jboss 3.0 RC3 CMR problem
              tafypz

               

              "tafypz" wrote:
              Thank you Prabha,
              It's working fine now, I really appreciate your help.

              Have a good day
              Sebastien