@Override public boolean containsEntity(EntityManager em, Class<?> entityClass, Object id) { return em.unwrap(JpaEntityManager.class).getActiveSession().getIdentityMapAccessor().getFromIdentityMap(id, entityClass) != null; }
@Override public boolean containsEntity(EntityManager em, Class<?> entityClass, Object id) { return em.unwrap(JpaEntityManager.class).getActiveSession().getIdentityMapAccessor().getFromIdentityMap(id, entityClass) != null; }
/** * Returns the Object from the cache map with the id * and Class type. */ public Object getObject(Class cls, Object id) { getEntityManagerFactory().verifyOpen(); Object cacheKey = createPrimaryKeyFromId(cls, id); return getAccessor().getFromIdentityMap(cacheKey, cls); }
Object deletedObject = deletedObjects.next(); Vector primaryKey = keyFromObject(deletedObject); Object cloneFromParent = getParent().getIdentityMapAccessor().getFromIdentityMap(primaryKey, deletedObject.getClass());
Object clone = clones.get(deletedObject); if (clone == null) { clone = parent.getIdentityMapAccessor().getFromIdentityMap(primaryKey, deletedObject.getClass()); if (clone == null) { clone = deletedObject;
Object clone = clones.get(deletedObject); if (clone == null) { clone = parent.getIdentityMapAccessor().getFromIdentityMap(primaryKey, deletedObject.getClass()); if (clone == null) { clone = deletedObject;
reference = getIdentityMapAccessor().getFromIdentityMap(primaryKey, theClass); if (reference == null) { if ((id instanceof List) || (id instanceof CacheId) || (descriptor.getCMPPolicy() == null)) {
reference = getIdentityMapAccessor().getFromIdentityMap(primaryKeyValues, theClass); if (reference == null) { if (primaryKey instanceof List) {
reference = getIdentityMapAccessor().getFromIdentityMap(primaryKey, theClass); if (reference == null) { if ((id instanceof List) || (id instanceof CacheId) || (descriptor.getCMPPolicy() == null)) {
/** * This is used for a remote unit of work. * If the value holder is sent back to the server uninstantiated and * it needs to be instantiated, then we must find the original * object and get the appropriate attribute from it. */ protected Object getValueFromServerObject() { setSession(getRemoteUnitOfWork()); Object primaryKey = getSession().getId(getSourceObject()); Object originalObject = getUnitOfWork().getParent().getIdentityMapAccessor().getFromIdentityMap(primaryKey, getSourceObject().getClass()); if (originalObject == null) { originalObject = getUnitOfWork().getParent().readObject(getSourceObject()); } ClassDescriptor descriptor = getSession().getDescriptor(originalObject); DatabaseMapping mapping = descriptor.getObjectBuilder().getMappingForAttributeName(getSourceAttributeName()); setMapping(mapping); return getMapping().getRealAttributeValueFromObject(originalObject, getSession()); }
/** * This is used for a remote unit of work. * If the value holder is sent back to the server uninstantiated and * it needs to be instantiated, then we must find the original * object and get the appropriate attribute from it. */ protected Object getValueFromServerObject() { setSession(getRemoteUnitOfWork()); Vector primaryKey = getSession().keyFromObject(getSourceObject()); Object originalObject = getUnitOfWork().getParent().getIdentityMapAccessor().getFromIdentityMap(primaryKey, getSourceObject().getClass()); if (originalObject == null) { originalObject = getUnitOfWork().getParent().readObject(getSourceObject()); } ClassDescriptor descriptor = getSession().getDescriptor(originalObject); DatabaseMapping mapping = descriptor.getObjectBuilder().getMappingForAttributeName(getSourceAttributeName()); setMapping(mapping); return getMapping().getRealAttributeValueFromObject(originalObject, getSession()); }
/** * This is used for a remote unit of work. * If the value holder is sent back to the server uninstantiated and * it needs to be instantiated, then we must find the original * object and get the appropriate attribute from it. */ protected Object getValueFromServerObject() { setSession(getRemoteUnitOfWork()); Object primaryKey = getSession().getId(getSourceObject()); Object originalObject = getUnitOfWork().getParent().getIdentityMapAccessor().getFromIdentityMap(primaryKey, getSourceObject().getClass()); if (originalObject == null) { originalObject = getUnitOfWork().getParent().readObject(getSourceObject()); } ClassDescriptor descriptor = getSession().getDescriptor(originalObject); DatabaseMapping mapping = descriptor.getObjectBuilder().getMappingForAttributeName(getSourceAttributeName()); setMapping(mapping); return getMapping().getRealAttributeValueFromObject(originalObject, getSession()); }
Object value = session.getIdentityMapAccessor().getFromIdentityMap(pkVector, reference.getTargetClass()); Object value = session.getIdentityMapAccessor().getFromIdentityMap(reference.getPrimaryKeys(), reference.getTargetClass()); XMLObjectReferenceMapping mapping = (XMLObjectReferenceMapping)reference.getMapping(); if (value != null) {
return buildClonePart(cached, executionSession.getIdentityMapAccessor().getFromIdentityMap(cacheKey.getKey(), referenceClass), cacheKey, attributeValue, refreshCascade, executionSession);
return buildClonePart(cached, executionSession.getIdentityMapAccessor().getFromIdentityMap(cacheKey.getKey(), referenceClass), cacheKey, attributeValue, refreshCascade, executionSession);