1 Reply Latest reply on Jul 17, 2004 5:49 PM by triathlon98

    One to many relationship only shows last record in table

    iarizona

      I have created a simple EJB one-to-many unidirectional relationship between two EJB's.

      When Bean A is constructed, JBoss automatically creates N instances of Bean B, using the findByPrimaryKey(String) local method. Great, right?

      The N instances created correspond to the N entries in the table where Bean B is mapped to.

      The problem is that for each Bean B created, all the private data members of EACH Bean B contains the mapped data of the LAST ENTRY on the mapped table.

      Why is JBoss loading all Bean B's with the data from the last entry in the table instead of data from rows 1..N?

      I tried this on JBoss3.2.3 and JBoss3.2.5 and the same thing happens.

      Any ideas would be appreciated. And please email a copy of your posting to iarizona@yahoo.com since I would like to get this resolved ASAP.

      Thank you very much.