code: public static EntityMetadata getEntityMetadata(final KunderaMetadata kunderaMetadata, Class entityClass)
      {
          if (entityClass == null)
          {
              throw new KunderaException("Invalid class provided " + entityClass);
          }
          List<String> persistenceUnits = kunderaMetadata.getApplicationMetadata().getMappedPersistenceUnit(entityClass);
  
          // persistence units will only have more than 1 persistence unit in case
          // of RDBMS.
          if (persistenceUnits != null)
          {
              for (String pu : persistenceUnits)
              {
                  MetamodelImpl metamodel = getMetamodel(kunderaMetadata, pu);
                  EntityMetadata metadata = metamodel.getEntityMetadata(entityClass);
                  if (metadata != null && metadata.getPersistenceUnit().equals(pu))
                  {
                      return metadata;
                  }
              }
          }
          if (log.isDebugEnabled())
              log.warn("No Entity metadata found for the class " + entityClass
                      + ". Any CRUD operation on this entity will fail."
                      + "If your entity is for RDBMS, make sure you put fully qualified entity class"
                      + " name under <class></class> tag in persistence.xml for RDBMS "
                      + "persistence unit. Returning null value.");
  
          return null;
          // throw new KunderaException("Unable to load entity metadata for :" +
          // entityClass);
      }
docs: Finds ands returns Entity metadata for a given array of PUs.
  
  @param entityClass
  the entity class
  @param persistenceUnits
  the persistence units
  @return the entity metadata