code: private Object onIfSharedByPK(Relation relation, Object childObject, EntityMetadata childMetadata, Object entityId)
      {
          if (relation.isJoinedByPrimaryKey())
          {
              PropertyAccessorHelper.setId(childObject, childMetadata, entityId);
          }
  
          return childObject;
      }
docs: Check and set if relation is set via primary key.
  
  @param relation
  relation
  @param childObject
  target entity
  @param childMetadata
  target entity metadata
  @param entityId
  entity id
  @return target entity.