use of org.molgenis.data.meta.model.EntityTypeMetadata.ATTRIBUTES in project molgenis by molgenis.
the class UntypedTagService method findAttributeEntity.
private Entity findAttributeEntity(EntityType entityType, String attributeName) {
Entity entityTypeEntity = dataService.findOneById(ENTITY_TYPE_META_DATA, entityType.getId());
Optional<Entity> result = stream(entityTypeEntity.getEntities(ATTRIBUTES).spliterator(), false).filter(att -> attributeName.equals(att.getString(AttributeMetadata.NAME))).findFirst();
return result.orElse(null);
}
Aggregations