code: protected void addToRelationStack(Map<Object, Object> relationStack, Object entity, EntityMetadata m)
      {
          Object obj = entity;
          if (entity instanceof EnhanceEntity)
          {
              obj = ((EnhanceEntity) entity).getEntity();
          }
          relationStack.put(obj.getClass().getCanonicalName() + "#" + PropertyAccessorHelper.getId(obj, m), obj);
  
      }
docs: Adds the to relation stack.
  
  @param relationStack
  the relation stack
  @param entity
  the entity
  @param m
  the m