[ojb-users] Cascading deletes through ODMG
Brought to you by:
thma
From: Brian D. <bde...@in...> - 2002-05-24 00:40:36
|
Hi all, Is the ODMG API supposed to delete items in a 1:n collection automatically for you? I saw in the FAQ that "Objects are registered to a transaction so that on commit of the transaction it knows that d and e do not longer belong to the collection. the ODMG collection will not delete the objects d and e but only the REFERENCES from the collection to those objects!". I'm not sure exactly what is meant though by "REFERENCES" vs. the actual object in a 1:n relationship. I have a User object with a collection attribute for Permissions. When I find a persisted User, and then call remove a Permission from the User object's collection, and then commit the transaction, the related row in the permission table is not deleted. For example: transaction.begin(); String removePermID = "DNLD"; User user = ... find persisted user...; for(Iterator i = user.getPermissions().iterator(); i.hasNext;) { Permission perm = (Permission)i.next(); if(perm.getPermissionID().equals(removePermID) { user.getPermissions().remove(perm); } } transaction.commit(); Am I misunderstanding how its supposed to work? Thanks in advance, Brian -- Brian DeVries Sr. Software Engineer mailto:bde...@in... http://www.intraware.com Voice: 925.253.6516 Fax: 925.253.6785 -------------------------------------------------------- Intraware... The leading provider of Electronic Software Delivery and Management (ESDM) Solutions |