0 Replies Latest reply on May 3, 2002 3:30 PM by Ron Jawanda

    CMP 2 equals() behaviour for composite key class

    Ron Jawanda Novice

      I have a composite key class and have put print statements in my equals behaviour.
      I have 2 lines of data in my database but my equals() behaviour is being printed out 44 times.
      It must be wrong but I don't know why.

      I have a lot of EJB books so please :) don't reply "read a EJB book" The problem is that I am getting null values back in my get methods where I extract the data from the database. In jboss 2 it worked ok but jboss 3 there is a problem (possibly me). I have moved from CMP 1 to 2 and there is significant changes. Any idea?

      Thanks
      The output below is in my Primary Key class (because i have 4 fields that represent the key).
      The fields are cprj, item, pdno, ocmp.
      The reason there are blanks is because the database has CHAR(6) as the field def (god... can't do anything about it though... it is BAAN).

      Ron


      15:26:37,178 INFO [MainDeployer] Deploying: file:/C:/data/swi/jboss/deploy/jbos
      smq-state.xml
      15:26:37,225 INFO [MainDeployer] Started
      15:26:37,225 INFO [Server] JBoss (MX MicroKernel) [3.0.0beta Date:200202210220
      ] Started in 0m:22s:265ms
      15:28:34,850 INFO [Default] cprj [100 ] item [111 ] pdno[5] ocmp
      [1]
      15:28:34,850 INFO [Default] 6
      15:28:34,866 INFO [Default] cprj [101 ] item [222 ] pdno[6] ocmp
      [1]
      15:28:34,866 INFO [Default] 6
      15:28:34,866 INFO [Default] cprj [101 ] item [222 ] pdno[6] ocmp
      [1]
      15:28:34,866 INFO [Default] 6
      15:28:34,866 INFO [Default] cprj [101 ] item [222 ] pdno[6] ocmp
      [1]
      15:28:34,866 INFO [Default] 6
      15:28:34,866 INFO [Default] cprj [101 ] item [222 ] pdno[6] ocmp
      [1]
      15:28:34,866 INFO [Default] 6
      15:28:34,866 INFO [Default] cprj [101 ] item [222 ] pdno[6] ocmp
      [1]
      15:28:34,866 INFO [Default] 6
      15:28:34,866 INFO [Default] cprj [101 ] item [222 ] pdno[6] ocmp
      [1]
      15:28:34,866 INFO [Default] 6
      15:28:34,881 INFO [Default] cprj [100 ] item [111 ] pdno[5] ocmp
      [1]
      15:28:34,881 INFO [Default] 6
      15:28:34,913 INFO [Default] DETAIL IS null
      15:28:34,913 INFO [Default] Setting project!!!null
      15:28:34,913 INFO [Default] cprj [100 ] item [111 ] pdno[5] ocmp
      [1]
      15:28:34,913 INFO [Default] 6
      15:28:34,928 INFO [Default] cprj [100 ] item [111 ] pdno[5] ocmp
      [1]
      15:28:34,928 INFO [Default] 6
      15:28:34,944 INFO [Default] cprj [100 ] item [111 ] pdno[5] ocmp
      [1]
      15:28:34,944 INFO [Default] 6
      15:28:34,944 INFO [Default] cprj [100 ] item [111 ] pdno[5] ocmp
      [1]
      15:28:34,944 INFO [Default] 6
      15:28:34,975 INFO [Default] cprj [100 ] item [111 ] pdno[5] ocmp
      [1]
      15:28:34,975 INFO [Default] 6
      15:28:34,975 INFO [Default] cprj [100 ] item [111 ] pdno[5] ocmp
      [1]
      15:28:34,975 INFO [Default] 6
      15:28:34,991 INFO [Default] cprj [101 ] item [222 ] pdno[6] ocmp
      [1]
      15:28:34,991 INFO [Default] 6
      15:28:34,991 INFO [Default] cprj [101 ] item [222 ] pdno[6] ocmp
      [1]
      15:28:34,991 INFO [Default] 6
      15:28:34,991 INFO [Default] cprj [101 ] item [222 ] pdno[6] ocmp
      [1]
      15:28:34,991 INFO [Default] 6
      15:28:34,991 INFO [Default] cprj [101 ] item [222 ] pdno[6] ocmp
      [1]
      15:28:35,006 INFO [Default] 6
      15:28:35,006 INFO [Default] cprj [101 ] item [222 ] pdno[6] ocmp
      [1]
      15:28:35,006 INFO [Default] 6
      15:28:35,006 INFO [Default] cprj [101 ] item [222 ] pdno[6] ocmp
      [1]
      15:28:35,006 INFO [Default] 6
      15:28:35,038 INFO [Default] cprj [100 ] item [111 ] pdno[5] ocmp
      [1]
      15:28:35,038 INFO [Default] 6
      15:28:35,038 INFO [Default] DETAIL IS null
      15:28:35,038 INFO [Default] Setting project!!!null
      15:28:35,038 INFO [Default] cprj [100 ] item [111 ] pdno[5] ocmp
      [1]
      15:28:35,038 INFO [Default] 6
      15:28:35,053 INFO [Default] cprj [100 ] item [111 ] pdno[5] ocmp
      [1]
      15:28:35,053 INFO [Default] 6
      15:28:35,069 INFO [Default] cprj [100 ] item [111 ] pdno[5] ocmp
      [1]
      15:28:35,069 INFO [Default] 6
      15:28:35,085 INFO [Default] cprj [100 ] item [111 ] pdno[5] ocmp
      [1]
      15:28:35,085 INFO [Default] 6
      15:28:35,116 INFO [Default] cprj [101 ] item [222 ] pdno[6] ocmp
      [1]
      15:28:35,116 INFO [Default] 6
      15:28:35,131 INFO [Default] DETAIL IS null
      15:28:35,131 INFO [Default] Setting project!!!null
      15:28:35,131 INFO [Default] cprj [101 ] item [222 ] pdno[6] ocmp
      [1]
      15:28:35,131 INFO [Default] 6