I've read Sun's jsdk1.2.1 examples (ejb 1.1) about
mapping 1-n "weak"-relationship, such as
Order and
LineItems. In the example,
LineItems was implemented
as ordinary serializable class, while
Order was
implemented as bmp-entity bean.
I would like to know how to "convert" that "schema"
to cmp, especially how to instruct (in deployment
descriptor) the container to update table
line_items
in dbms via the
Order entity bean.
Is it as simple as I'm asumming, just need to add some
line in the dd (part or
<entity>), or is it related with
transaction (i.e I need to use transaction to update/
insert into table
order and
line_items)?
public class LineItems()
{
private int lineNumber;
private String orderId;
/* other fields */
public int getLineNumber() ...
public void setLineNumber() ...
/* and soon */
}
public class OrderBean implements EntityBean {
public String orderId;
private ArrayList lineItems;
public String ejbCreate(String orderId,ArrayList lineItems)
{
this.orderId = orderId;
/* Is this correct?
this.lineItems = lineItems;
*/
return null;
}
}
Thanks in advance.