code: public void setParentKetMetadata(ParentKeyMetadata parentKeyMetadata) {
      if (this.parentKeyMetadata != null) {
        String format = "Class %s has two fields, %s and %s marked with %s annotation. Only one "
            + "field can be marked as ParentKey. ";
        String message = String.format(format, entityClass.getName(),
            this.parentKeyMetadata.getName(), parentKeyMetadata.getName(), ParentKey.class.getName());
        throw new EntityManagerException(message);
  
      }
      this.parentKeyMetadata = parentKeyMetadata;
    }
docs: Sets the metadata about the parent key.
  
  @param parentKeyMetadata
  the parent key metadata.