use of org.molgenis.data.MolgenisDataAccessException in project molgenis by molgenis.
the class SemanticSearchServiceHelper method getAttributeIdentifiers.
/**
* A helper function that gets identifiers of all the attributes from one EntityType
*/
public List<String> getAttributeIdentifiers(EntityType sourceEntityType) {
Entity EntityTypeEntity = dataService.findOne(ENTITY_TYPE_META_DATA, new QueryImpl<>().eq(EntityTypeMetadata.ID, sourceEntityType.getId()));
if (EntityTypeEntity == null)
throw new MolgenisDataAccessException("Could not find EntityTypeEntity by the name of " + sourceEntityType.getId());
List<String> attributeIdentifiers = new ArrayList<>();
recursivelyCollectAttributeIdentifiers(EntityTypeEntity.getEntities(EntityTypeMetadata.ATTRIBUTES), attributeIdentifiers);
return attributeIdentifiers;
}
use of org.molgenis.data.MolgenisDataAccessException in project molgenis by molgenis.
the class ImportServiceIT method getFile.
static File getFile(String resourceName) {
requireNonNull(resourceName);
try {
File file = ResourceUtils.getFile(ImportServiceIT.class, resourceName);
LOG.trace("emx import integration test file: [{}]", file);
return file;
} catch (Exception e) {
LOG.error("File name: [{}]", resourceName);
throw new MolgenisDataAccessException(e);
}
}
Aggregations