Order and LineItem in cmp, how?
I've read Sun's jsdk1.2.1 examples (ejb 1.1) about
mapping 1-n "weak"-relationship, such asOrder and
LineItems. In the example,LineItems was implemented
as ordinary serializable class, whileOrder 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 tableline_items
in dbms via theOrder 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 tableorder andline_items)?
publicclass LineItems()
{
privateint lineNumber;
private String orderId;
/* other fields */
publicint getLineNumber() ...
publicvoid setLineNumber() ...
/* and soon */
}
publicclass OrderBeanimplements EntityBean{
public String orderId;
private ArrayList lineItems;
public String ejbCreate(String orderId,ArrayList lineItems)
{
this.orderId = orderId;
/* Is this correct?
this.lineItems = lineItems;
*/
returnnull;
}
}
Thanks in advance.

