code: public void remove(Object e)
      {
          // Invoke Pre Remove Events
  
          // TODO Check for validity also as per JPA
          if (e == null)
          {
              throw new IllegalArgumentException("Entity to be removed must not be null.");
          }
  
          EntityMetadata metadata = getMetadata(e.getClass());
  
          // Create an object graph of the entity object
          ObjectGraph graph = new GraphGenerator().generateGraph(e, this, new ManagedState());
  
          Node node = graph.getHeadNode();
  
          try
          {
              lock.writeLock().lock();
  
              // TODO : push into action queue, get original end-point from
              // persistenceContext first!
  
              // Action/ExecutionQueue/ActivityQueue :-> id, name, EndPoint,
              // changed
              // state
  
              // Change state of node, after successful flush processing.
              node.setPersistenceDelegator(this);
              node.remove();
  
              // build flush stack.
  
              flushManager.buildFlushStack(node, EventType.DELETE);
  
              // Flush node.
              flush();
          }
          finally
          {
              lock.writeLock().unlock();
          }
          // clear out graph
          graph.clear();
          graph = null;
  
          if (log.isDebugEnabled())
          {
              log.debug("Data removed successfully for entity : " + e.getClass());
          }
      }
docs: Removes an entity object from persistence cache.