Object cacheObject, int lock, Stack stack, boolean buildingObject)
throws LockingException
{
ContextEntry entry;
boolean onlyDependants = !_tx.getKit().isImplicitLockingUsed();
ClassDescriptor mif = _pb.getClassDescriptor(userObject.getClass());
// N:1 relations
Iterator iter = mif.getObjectReferenceDescriptors().iterator();
ObjectReferenceDescriptor rds = null;
PersistentField f;
Object relUserObj;
Identity relOid;
boolean isDependent;
while (iter.hasNext())
{
rds = (ObjectReferenceDescriptor) iter.next();
isDependent = rds.getOtmDependent();
if (onlyDependants && !isDependent)
{
continue;
}
f = rds.getPersistentField();
relUserObj = f.get(userObject);
if (relUserObj != null)
{
relOid = new Identity(relUserObj, _pb);
entry = (ContextEntry) _objects.get(relOid);
if ((entry == null) || (entry.userObject != relUserObj))
{
entry = insertInternal(relOid, relUserObj, lock, isDependent,
oid, stack);
if (buildingObject && (entry != null))
{
f.set(userObject, entry.userObject);
f.set(cacheObject, entry.cacheObject);
}
}
}
}
// 1:N relations
Iterator collections = mif.getCollectionDescriptors().iterator();
CollectionDescriptor cds;
Object userCol;
Iterator userColIterator;
Class type;
ArrayList newUserCol = null;