code: protected final boolean entityExists(final String entityName) {
          final Set<EntityType<?>> entityTypes = getEm().getMetamodel().getEntities();
          for (final EntityType<?> entityType : entityTypes) {
              if (entityType.getName().equals(entityName)) {
                  return true;
              }
          }
          return false;
      }
docs: Returns if an entity with agiven name exists.
  
  @param entityName
  Entity to test.
  
  @return TRUE if the entity is known, else FALSE.