code: private Entity toEntity(MappingProject mappingProject) {
      Entity result = new DynamicEntity(mappingProjectMeta);
      if (mappingProject.getIdentifier() == null) {
        mappingProject.setIdentifier(idGenerator.generateId());
      }
      result.set(MappingProjectMetadata.IDENTIFIER, mappingProject.getIdentifier());
      result.set(MappingProjectMetadata.NAME, mappingProject.getName());
      result.set(DEPTH, mappingProject.getDepth());
      List<Entity> mappingTargetEntities =
          mappingTargetRepo.upsert(mappingProject.getMappingTargets());
      result.set(MappingProjectMetadata.MAPPING_TARGETS, mappingTargetEntities);
      return result;
    }
docs: Creates a new Entity for a MappingProject. Upserts the {@link MappingProject}'s {@link
  MappingTarget}s in the {@link #mappingTargetRepo}.
  
  @param mappingProject the {@link MappingProject} used to create an Entity
  @return Entity filled with the data from the MappingProject