I posted a message (included below) to the group and was rather dispondant to get nothing back. I think that it highlights a CMP 2.0 bug but no one seems to care one way or another. I'm perfectly will be provide and EAR and a rather hacked up test client... I do think however that it seems a CMP relationship with a bean of the same type doesn't seem to work.
Can someone please look at this as the only BUG report for CMP relationships I saw on sourceforge was very dismissive of the reporter.
Regards to all,
Is CMP 2.0 working properly? Posted: Mar 25, 2002
I have solved the problem of JBoss not allowing me to deploy by specifying a related-pk-field in the @jboss:relation tag in xdoclet (post on EJB forum: Can EJB's reference their own class?). Now I have other problems...
1) The relationship is supposed to be bi-directional... I thought if I called setParent() on a Message, it would also add the child to the collection of children. It doesn't...
2) JBoss returns null if I call getChildren() when there are no children. I can't call add() therefore and creating my own collection and calling setChildren() doesn't work...
3) Orion does one direction but not both, i.e. I can setParen() and parent is set but children aren't added. I can add a child (as I get a *real* Collection back not null) but it doesn't set the parent.
Am I missing something obvious here? At least in Orion if I call x.setParent(y); y.addChildren(x); I get the result I want even if it should (AFAIK) be automated by calling either method. JBoss fails to do either.