5 Replies Latest reply on May 2, 2002 3:49 AM by cnsxxx09

    CMR bug?

    cnsxxx09

      Hi, I'm using JBoss3 alpha....I will upgrade to RC1 as soon as I figure out what has changed and what I need to configure differently.

      in the meantime, I have a CMR and when I add a bean to another bean I see the following in the log file:
      [2002-04-30 10:48:30,188,CMP,DEBUG] FindByForeignKey command executing: SELECT addno FROM address WHERE employee_no=?

      ..this is an error because with Oracle there should be a dot and not an underscore....so the column should read employee.no

      Out of curiosity, was this a know bug or did I miss something in the config? (if so I need to know for when I upgrade).

      Normal (non CMR) works fine

      TIA

      Chris
      -=-=-

        • 1. Re: CMR bug?
          dsundstrom

          Why should it be a dot instead of an underscore? JBossCMP does not support a column name that contains a dot.

          • 2. Re: CMR bug?
            cnsxxx09

            Quite simple because 'employee' is the name of the table and 'no' is the name of the column....therefore
            select * from employee where employee.no > 1
            or
            select * from department where department.no > 1
            will both work fine.

            Chris
            -=-=-=

            • 3. Re: CMR bug?
              cnsxxx09

              ...looking at it in more detail....I cannot figure out where it is getting "employee_no" from anyway.

              The statement is:
              select addno from Address where employee_no = ?

              The Foreign Key column is actually called 'employee' (there is no 'employee_no' column anywhere ) and refers to the Primary Key column 'no' in the 'Employee' table.
              None of my columns or fields have an underscore.

              Maybe there is an error in my jbosscmp-jdbc.xml file?

              Where does the underscore come from? how is it built up?

              TIA

              Chris
              -=-=-

              • 4. Re: CMR bug?
                dsundstrom

                My guess is you have foreign keys in both tables. Take a close look at your create table statements. If you are not allowing JBossCMP to create the tables, make sure that the employee side of the relationship has an empty key-fields element. <key-fields/>

                • 5. Re: CMR bug?
                  cnsxxx09

                  the problem was thaI had a column for my foreign key in my entity bean...as I remember some time ago that WebLogic complained if it wasn't there...I removed it and it works!

                  Thanks

                  Chris
                  -=-=-