code: static void validateEntityId(EntityType entityType) {
      // validate entity name (e.g. illegal characters, length)
      String id = entityType.getId();
      if (!id.equals(ATTRIBUTE_META_DATA)
          && !id.equals(ENTITY_TYPE_META_DATA)
          && !id.equals(PACKAGE)) {
        try {
          NameValidator.validateEntityName(entityType.getId());
        } catch (MolgenisDataException e) {
          throw new MolgenisValidationException(new ConstraintViolation(e.getMessage()));
        }
      }
    }
docs: Validates the entity ID: - Validates that the entity ID does not contain illegal characters and
  validates the name length
  
  @param entityType entity meta data
  @throws MolgenisValidationException if the entity simple name content is invalid or the fully
  qualified name, simple name and package name are not consistent