code: private EntityMetadata belongsToPersistenceUnit(EntityMetadata metadata)
      {
  
          // if pu is null and client is not rdbms OR metadata pu does not match
          // with configured one. don't process for anything.
  
          PersistenceUnitMetadata puMetadata = kunderaMetadata.getApplicationMetadata()
                  .getPersistenceUnitMetadata(persistenceUnit);
          String keyspace = puProperties != null ? (String) puProperties.get(PersistenceProperties.KUNDERA_KEYSPACE):null;
          
          keyspace = keyspace == null ? puMetadata.getProperty(PersistenceProperties.KUNDERA_KEYSPACE):keyspace;
  
          if (metadata.getPersistenceUnit() != null && !metadata.getPersistenceUnit().equals(persistenceUnit)
                  || (keyspace != null && metadata.getSchema() != null && !metadata.getSchema().equals(keyspace)))
          {
              metadata = null;
          }
          else
          {
              applyMetadataChanges(metadata);
          }
  
          /*
           * if ((metadata.getPersistenceUnit() == null &&
           * !(Constants.RDBMS_CLIENT_FACTORY.equalsIgnoreCase(client) ||
           * Constants.NEO4J_CLIENT_FACTORY .equalsIgnoreCase(client))) ||
           * metadata.getPersistenceUnit() != null &&
           * !metadata.getPersistenceUnit().equals(persistenceUnit)) { metadata =
           * null; }
           */
  
          return metadata;
      }
docs: If parameterised metadata is not for intended persistence unit, assign it
  to null.
  
  @param metadata
  entity metadata
  @return metadata.