/** * ADVANCED: * Return if their is an object for the row containing primary key and the class. */ public boolean containsObjectInIdentityMap(Record rowContainingPrimaryKey, Class theClass) { return containsObjectInIdentityMap(extractPrimaryKeyFromRow(rowContainingPrimaryKey, theClass), theClass); }
/** * ADVANCED: * Return if their is an object for the primary key. */ public boolean containsObjectInIdentityMap(Object object) { return containsObjectInIdentityMap(getSession().keyFromObject(object), object.getClass()); }
/** * ADVANCED: * Return if their is an object for the primary key. */ public boolean containsObjectInIdentityMap(Vector primaryKey, Class theClass) { ClassDescriptor descriptor = getSession().getDescriptor(theClass); return containsObjectInIdentityMap(primaryKey, theClass, descriptor); }
/** * INTERNAL: * Return if their is an object for the primary key. */ public boolean containsObjectInIdentityMap(Vector primaryKey, Class theClass, ClassDescriptor descriptor) { if (getIdentityMapManager().containsKey(primaryKey, theClass, descriptor)) { return true; } return ((UnitOfWorkImpl)getSession()).getParent().getIdentityMapAccessorInstance().containsObjectInIdentityMap(primaryKey, theClass, descriptor); }
public void iterate(Object object) { if (!containsObjectInIdentityMap(IdentityMapAccessor.this.session.getDescriptor(object.getClass()).getObjectBuilder().extractPrimaryKeyFromObject(object, IdentityMapAccessor.this.getSession()), object.getClass())) { IdentityMapAccessor.this.session.log(SessionLog.FINEST, SessionLog.CACHE, "stack_of_visited_objects_that_refer_to_the_corrupt_object", getVisitedStack()); IdentityMapAccessor.this.session.log(SessionLog.FINER, SessionLog.CACHE, "corrupt_object_referenced_through_mapping", getCurrentMapping()); IdentityMapAccessor.this.session.log(SessionLog.FINER, SessionLog.CACHE, "corrupt_object", object); } } };
/** * ADVANCED: * Return if their is an object for the primary key. */ public boolean containsObjectInIdentityMap(Vector primaryKey, Class theClass, ClassDescriptor descriptor) { if (descriptor.isIsolated()) { return getIdentityMapManager().containsKey(primaryKey, theClass, descriptor); } else { return ((IsolatedClientSession)session).getParent().getIdentityMapAccessorInstance().containsObjectInIdentityMap(primaryKey, theClass, descriptor); } }
/** * INTERNAL: * Return whether the clone object is already registered. */ public boolean isObjectRegistered(Object clone) { if (getCloneMapping().containsKey(clone)) { return true; } // We do smart merge here if (isSmartMerge()){ ClassDescriptor descriptor = getDescriptor(clone); if (getParent().getIdentityMapAccessorInstance().containsObjectInIdentityMap(keyFromObject(clone, descriptor), clone.getClass(), descriptor) ) { mergeCloneWithReferences(clone); // don't put clone in clone mapping since it would result in duplicate clone return true; } } return false; }
if (getParent().getIdentityMapAccessorInstance().containsObjectInIdentityMap(primaryKey, clone.getClass(), descriptor)) {