You can refer in the detail beans to the master bean using a foreign key, that is add a field to the one bean (the foreign key) which refers to the many bean.
What exactly is "many bean"? So far I have to implement a BPM-type bean and create additional table in the database holding information about one-to-many references among my beans (the many-sided bean may be CMP-type).
Check out EJB 2.0 persistance.
(For jBoss, at the moment, only available with a add on from mvcsoft.com)
You cannot save an array of beans because this is neither a simple Java type nor a serializable
Get yourself Handles to the Objects and put them into a Container. This is a serializable Object so this Method works (at least for me). You will just have to re-get the Objects from the Handles ...
(If this works for me only by chance please mail me a note...)
Storing an array of primary key objects for the related beans rather than handles should give better flexibility and performance at the expense of "good" OO principals (IMHO).
I made a simple example using an Order EJB which has many OrderLine EJBs. Each OrderLine has only one Order. Classic 1-N relationship. I stored the Order PrimaryKey (in my case a string) in the OrderLine and when i wanted to get the order lines for an order I called order.getOrderLines() which returned a collection of OrderLine references. This method called findByOrderId(order.getId()) from the OrderLineHome interface. Seemed to work ok for me. It is possible to do n-n relationships like this too.
For more info see www.geocities.com/haytona/reltut/ for more info and code examples.
hope this helps