code: <E> E find(final Class<E> entityClass, final Object primaryKey)
      {
          if (primaryKey == null)
          {
              throw new IllegalArgumentException("PrimaryKey value must not be null for object you want to find.");
          }
          // Locking as it might read from persistence context.
  
          EntityMetadata entityMetadata = getMetadata(entityClass);
  
          String nodeId = ObjectGraphUtils.getNodeId(primaryKey, entityClass);
  
          // TODO all the scrap should go from here.
          MainCache mainCache = (MainCache) getPersistenceCache().getMainCache();
          Node node = mainCache.getNodeFromCache(nodeId, this);
  
          // if node is not in persistence cache or is dirty, fetch from database
          if (node == null || node.isDirty())
          {
              node = new Node(nodeId, entityClass, new ManagedState(), getPersistenceCache(), primaryKey, this);
              node.setClient(getClient(entityMetadata));
              // TODO ManagedState.java require serious attention.
              node.setPersistenceDelegator(this);
  
              try
              {
                  lock.readLock().lock();
                  node.find();
              }
              finally
              {
                  lock.readLock().unlock();
              }
          }
          else
          {
              node.setPersistenceDelegator(this);
          }
          Object nodeData = node.getData();
          if (nodeData == null)
          {
              return null;
          }
          else
          {
              E e = (E) ObjectUtils.deepCopy(nodeData, getKunderaMetadata());
              onSetProxyOwners(entityMetadata, e);
              return e;
          }
      }
docs: Finds an entity from persistence cache, if not there, fetches from
  database. Nodes are added into persistence cache (if not already there)
  as and when they are found from DB. While adding nodes to persistence
  cache, a deep copy is added, so that found object doesn't refer to
  managed entity in persistence cache.
  
  @param entityClass
  Entity Class
  @param primaryKey
  Primary Key
  @return Entity Object for the given primary key