code: <E> Node generate(E entity, PersistenceDelegator delegator, PersistenceCache pc, NodeState state)
      {
  
          EntityMetadata entityMetadata = KunderaMetadataManager.getEntityMetadata(delegator.getKunderaMetadata(),
                  entity.getClass());
  
          if (!new NullOrInvalidEntityRule<E>(entityMetadata).validate(entity))
          {
              Object entityId = onPreChecks(entity, delegator);
  
              // TODO::check for composite key.
              Node node = builder.buildNode(entity, delegator, entityId, state);
  
              node = traverseNode(entity, delegator, pc, entityId, node);
  
              return node;
          }
  
          return null;
      }
docs: Generate graph for head node. <li>traverse through it's relational
  entities recursively
  
  @param entity
  entity object
  @param delegator
  delegator object
  @param pc
  persistence cache
  @return head node