private MappingTarget toMappingTarget(Entity mappingTargetEntity) {
    List<EntityMapping> entityMappings = Collections.emptyList();
    String identifier = mappingTargetEntity.getString(MappingTargetMetadata.IDENTIFIER);

    if (!dataService.hasRepository(mappingTargetEntity.getString(MappingTargetMetadata.TARGET))) {
      return null;
    }

    EntityType target =
        dataService.getEntityType(mappingTargetEntity.getString(MappingTargetMetadata.TARGET));

    if (mappingTargetEntity.getEntities(MappingTargetMetadata.ENTITY_MAPPINGS) != null) {
      List<Entity> entityMappingEntities =
          Lists.newArrayList(
              mappingTargetEntity.getEntities(MappingTargetMetadata.ENTITY_MAPPINGS));
      entityMappings = entityMappingRepository.toEntityMappings(entityMappingEntities);
    }

    return new MappingTarget(identifier, target, entityMappings);
  }
private MappingTarget toMappingTarget ( Entity mappingTargetEntity ) { List < EntityMapping > entityMappings = Collections . emptyList ( ) ; String identifier = mappingTargetEntity . getString ( MappingTargetMetadata . IDENTIFIER ) ; if ( ! dataService . hasRepository ( mappingTargetEntity . getString ( MappingTargetMetadata . TARGET ) ) ) { return null ; } EntityType target = dataService . getEntityType ( mappingTargetEntity . getString ( MappingTargetMetadata . TARGET ) ) ; if ( mappingTargetEntity . getEntities ( MappingTargetMetadata . ENTITY_MAPPINGS ) != null ) { List < Entity > entityMappingEntities = Lists . newArrayList ( mappingTargetEntity . getEntities ( MappingTargetMetadata . ENTITY_MAPPINGS ) ) ; entityMappings = entityMappingRepository . toEntityMappings ( entityMappingEntities ) ; } return new MappingTarget ( identifier , target , entityMappings ) ; }
Creates a fully reconstructed MappingProject from an Entity retrieved from the repository.

@param mappingTargetEntity Entity with {@link MappingProjectMetadata} metadata
@return fully reconstructed MappingProject