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: 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.