I believe that the semantic you are looking for is achieved by
employee.set("DEPARTMENTS",
null) or department.getList("EMPLOYEES").remove(employee).  Either of these
will remove the employee from the relationship and the FK will be updated
appropriately. The row will not be deleted

The RDB DAS provides a single SDO containment relationship from the root to
all elements in the graph.  So, dataObject.detach() acts the same as
dataObject.delete(); the DAS will assume that the object is removed from the
graph and therefore should be removed from the database.

Thanks,

--Kevin


On 4/23/07, Umesh Tyagi (utyagi) <[EMAIL PROTECTED]> wrote:

When I invoke detach() on a dataObject it is also deleted from the table
?
For example -
    DataObject department =
root.getDataObject("COMPANY[1]/departments[1]");
    department.detach();
    das.applyChanges(root);
deletes the row from the department table, and leaves the foreign key
reference in the employee table unchanged.
Here is what I read in specification document about detach() -
"DataObject can be removed from its container, without making any other
changes, using the detach() method."
So with above definition I was expecting only the foreign key
'companyid' in the department object to be set to null after calling
detach(), effectively detaching the department from its company. Is my
understanding of detach() wrong ?


thanks
-Umesh Tyagi

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Reply via email to