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 email@example.com since I would like to get this resolved ASAP.
Thank you very much.
CHeck the multiplicity of your link. Are you sure the other side is allowed to be linked (that is, you may need other-side-multiple, or else you are effectively building a 1-1 link).