posted 17 years ago
Hi all,
I am having trouble with updating an entity bean that's on the many side of a one-to-many relation. The entity bean owning the relation is Customer (on the one side); the other side is PhoneNumbers (many side): i.e., one customer can have many phone numbers.
Here are the two ways I tried, but neither worked correctly:
1. This ends up with a new row in the PhoneNumber table and it's orphaned also. The old row didn't get updated either.
2. This ends up with a new row in the PhoneNumber table with the proper relationship set up. But, the old row didn't get updated.
Assumptions:
em is the EntityManager;
customer is the Customer entity bean;
phoneNumber is the updated PhoneNumber entity bean that belongs to customer;
Can some one help me with this?
Thanks,
Tong