I think I got little bit idea how we can add the code there. I did something like this
_persistence.delete(tx.getConnection(oid.getMolder().getLockEngine()), ids); // Original statement inside delete method of ClassMolder
//After that I did something like this
ClassMolder extended = this.getExtends();
// Must delete record in parent table last.
// All other dependents have been deleted before.
if (extended != null)
{
extended._persistence.delete(tx.getConnection(oid.getMolder().getLockEngine()), ids);
}
Is that fine? If it is, then I will make a patch today so that you can review the changes.
Thanks
Hi Ralf,
I went through the stuff related to shifting extended part of code. I found the following method in classmolder in which it is using _persistence.delete statement. Is this the place where we can move the extended refactored code snippet?
/** * Delete an object of the base type from the persistence storage. * All object to be deleted by this method will be <tt>markDelete</tt> * before it method is called. * * @param tx - transaction in action * @param oid - the object identity of the target object */ public void delete(final TransactionContext tx, final OID oid) throws PersistenceException { resetResolvers(); Identity ids = oid.getIdentity(); for (int i = 0; i < _fhs.length; i++) { if (_fhs[i].isManyToMany()) { _fhs[i].getRelationLoader().deleteRelation( tx.getConnection(oid.getMolder().getLockEngine()), ids); } } _persistence.delete(tx.getConnection(oid.getMolder().getLockEngine()), ids); <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< // All field along the extend path will be deleted by transaction // However, everything off the path must be deleted by ClassMolder. Vector<ClassMolder> extendPath = new Vector<ClassMolder>(); ClassMolder base = this; while (base != null) { extendPath.add(base); base = base._extends; } base = _depends; while (base != null) { if (base._extendent != null) { for (int i = 0; i < base._extendent.size(); i++) { if (extendPath.contains(base._extendent.get(i))) { // NB: further INVESTIGATION } } } base = base._extends; } }Thanks.