code: public void addEntityMetadata(String persistenceUnit, Class<?> clazz, EntityMetadata entityMetadata)
      {
          Metamodel metamodel = getMetamodelMap().get(persistenceUnit);
          Map<String, EntityMetadata> entityClassToMetadataMap = ((MetamodelImpl) metamodel).getEntityMetadataMap();
          if (entityClassToMetadataMap == null || entityClassToMetadataMap.isEmpty())
          {
              entityClassToMetadataMap.put(clazz.getName(), entityMetadata);
          }
          else
          {
              if (logger.isDebugEnabled())
                  logger.debug("Entity meta model already exists for persistence unit " + persistenceUnit + " and class "
                          + clazz + ". Noting needs to be done");
          }
      }
docs: Adds the entity metadata.
  
  @param persistenceUnit
  the persistence unit
  @param clazz
  the clazz
  @param entityMetadata
  the entity metadata