Skip to Main Content

Java EE (Java Enterprise Edition) General Discussion

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Order and LineItem in cmp, how?

843829Aug 10 2001 — edited Aug 10 2001
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.
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Sep 7 2001
Added on Aug 10 2001
1 comment
97 views