本文整理了Java中org.molgenis.data.Entity.getEntity()
方法的一些代码示例,展示了Entity.getEntity()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Entity.getEntity()
方法的具体详情如下:
包路径:org.molgenis.data.Entity
类名称:Entity
方法名:getEntity
暂无
代码示例来源:origin: org.molgenis/molgenis-settings
@Override
public Entity getEntity(String attributeName) {
return getEntity().getEntity(attributeName);
}
代码示例来源:origin: org.molgenis/molgenis-data-validation
private ConstraintViolation checkXref(Entity entity, Attribute attr, EntityType entityType) {
Entity refEntity;
try {
refEntity = entity.getEntity(attr.getName());
} catch (Exception e) {
return createConstraintViolation(entity, attr, entityType, "Not a valid entity.");
}
if (refEntity == null) {
return null;
}
if (!refEntity.getEntityType().getId().equals(attr.getRefEntity().getId())) {
return createConstraintViolation(entity, attr, entityType, "Not a valid entity type.");
}
return null;
}
代码示例来源:origin: org.molgenis/molgenis-settings
@Override
public <E extends Entity> E getEntity(String attributeName, Class<E> clazz) {
return getEntity().getEntity(attributeName, clazz);
}
代码示例来源:origin: org.molgenis/molgenis-data-validation
Entity refEntity = entity.getEntity(refAttr.getName());
if (refEntity != null) {
refEntities = singleton(refEntity);
代码示例来源:origin: org.molgenis/molgenis-navigator
@Override
public Entity getEntity(String attributeName) {
Entity entity = delegate().getEntity(attributeName);
return entity != null ? newPretendingEntity(entity) : null;
}
代码示例来源:origin: org.molgenis/molgenis-navigator
/**
* Because the File datatype has a reference to {@link FileMetaMetaData} it can happen that a
* typed FileMeta Entity is requested.
*/
@Override
@SuppressWarnings("unchecked")
public <E extends Entity> E getEntity(String attributeName, Class<E> clazz) {
Entity entity = delegate().getEntity(attributeName, clazz);
if (clazz.equals(FileMeta.class)) {
return entity != null ? (E) new FileMeta(newPretendingEntity(entity)) : null;
} else {
throw new UnsupportedOperationException("Can't return typed pretending entities");
}
}
代码示例来源:origin: org.molgenis/molgenis-data-annotators
@Override
public Entity next()
{
Entity variant = null;
String peekedId;
List<Entity> effectsForVariant = Lists.newArrayList();
while (effects.hasNext())
{
peekedId = effects.peek().getEntity(VARIANT).getIdValue().toString();
if (variant == null || variant.getIdValue().toString().equals(peekedId))
{
Entity effect = effects.next();
variant = effect.getEntity(VARIANT);
effectsForVariant.add(effect);
}
else
{
return createVcfEntityStructureForSingleEntity(variant, effectsForVariant);
}
}
return createVcfEntityStructureForSingleEntity(variant, effectsForVariant);
}
代码示例来源:origin: org.molgenis/molgenis-annotators-cmd
@Override
public Entity next()
{
Entity variant = null;
String peekedId;
List<Entity> effectsForVariant = Lists.newArrayList();
while (effects.hasNext())
{
peekedId = effects.peek().getEntity(VARIANT).getIdValue().toString();
if (variant == null || variant.getIdValue().toString().equals(peekedId))
{
Entity effect = effects.next();
variant = effect.getEntity(VARIANT);
effectsForVariant.add(effect);
}
else
{
return createVcfEntityStructureForSingleEntity(variant, effectsForVariant);
}
}
return createVcfEntityStructureForSingleEntity(variant, effectsForVariant);
}
代码示例来源:origin: org.molgenis/molgenis-data-cache
/**
* Evict all entity instances referenced by this entity instance through a bidirectional relation.
*
* @param entity the entity whose references need to be evicted
*/
private void evictBiDiReferencedEntities(Entity entity) {
Stream<EntityKey> backreffingEntities =
getEntityType()
.getMappedByAttributes()
.flatMap(
mappedByAttr ->
stream(entity.getEntities(mappedByAttr.getName()).spliterator(), false))
.map(EntityKey::create);
Stream<EntityKey> manyToOneEntities =
getEntityType()
.getInversedByAttributes()
.map(inversedByAttr -> entity.getEntity(inversedByAttr.getName()))
.filter(Objects::nonNull)
.map(EntityKey::create);
l1Cache.evict(Stream.concat(backreffingEntities, manyToOneEntities));
}
}
代码示例来源:origin: org.molgenis/molgenis-data-annotators
private String concatAttributeNameValue(Attribute attribute)
{
String value;
if (attribute.getName().equals(VARIANT))
{
value = getFailedEntity().getEntity(VARIANT).getIdValue().toString();
}
else
{
value = getFailedEntity().get(attribute.getName()).toString();
}
return attribute.getName() + "=" + value;
}
}
代码示例来源:origin: org.molgenis/molgenis-ontology-core
/**
* Retrieve all descendant ontology terms
*
* @return a list of {@link OntologyTerm}
*/
public List<OntologyTerm> getChildren(OntologyTerm ontologyTerm) {
Iterable<org.molgenis.ontology.core.meta.OntologyTerm> ontologyTermEntities =
() ->
dataService
.query(ONTOLOGY_TERM, org.molgenis.ontology.core.meta.OntologyTerm.class)
.eq(ONTOLOGY_TERM_IRI, ontologyTerm.getIRI())
.findAll()
.iterator();
List<OntologyTerm> children = new ArrayList<>();
for (Entity ontologyTermEntity : ontologyTermEntities) {
Entity ontologyEntity = ontologyTermEntity.getEntity(OntologyTermMetaData.ONTOLOGY);
ontologyTermEntity
.getEntities(OntologyTermMetaData.ONTOLOGY_TERM_NODE_PATH)
.forEach(
ontologyTermNodePathEntity ->
children.addAll(
getChildOntologyTermsByNodePath(ontologyEntity, ontologyTermNodePathEntity)));
}
return children;
}
代码示例来源:origin: org.molgenis/molgenis-data-mapper
/**
* Creates a fully reconstructed MappingProject from an Entity retrieved from the repository.
*
* @param mappingProjectEntity Entity with {@link MappingProjectMetaData} metadata
* @return fully reconstructed MappingProject
*/
private MappingProject toMappingProject(Entity mappingProjectEntity)
{
String identifier = mappingProjectEntity.getString(MappingProjectMetaData.IDENTIFIER);
String name = mappingProjectEntity.getString(MappingProjectMetaData.NAME);
User owner = mappingProjectEntity.getEntity(MappingProjectMetaData.OWNER, User.class);
List<Entity> mappingTargetEntities = Lists
.newArrayList(mappingProjectEntity.getEntities(MappingProjectMetaData.MAPPING_TARGETS));
List<MappingTarget> mappingTargets = mappingTargetRepo.toMappingTargets(mappingTargetEntities);
return new MappingProject(identifier, name, owner, mappingTargets);
}
代码示例来源:origin: org.molgenis/molgenis-data-cache
case FILE:
case XREF:
Entity xrefEntity = entity.getEntity(name);
value = xrefEntity != null ? xrefEntity.getIdValue() : null;
break;
代码示例来源:origin: org.molgenis/molgenis-ontology
NumberFormat format = NumberFormat.getNumberInstance();
format.setMaximumFractionDigits(2);
Entity inputEntity = resultEntity.getEntity(MatchingTaskContentMetaData.INPUT_TERM);
Entity ontologyTermEntity =
sortaService.getOntologyTermEntity(
代码示例来源:origin: org.molgenis/molgenis-data-index
.forEach(
inversedByAttr -> {
Entity refEntity = entity.getEntity(inversedByAttr.getName());
if (refEntity != null) {
EntityType inversedByAttrRefEntity = inversedByAttr.getRefEntity();
代码示例来源:origin: org.molgenis/molgenis-ontology
mappingEntity -> {
Map<String, Object> outputEntity = new HashMap<>();
outputEntity.put("inputTerm", getEntityAsMap(mappingEntity.getEntity(INPUT_TERM)));
outputEntity.put("matchedTerm", getEntityAsMap(mappingEntity));
Object matchedTerm = mappingEntity.get(MATCHED_TERM);
代码示例来源:origin: org.molgenis/molgenis-data-validation
case XREF:
case FILE:
Entity refEntity = entity.getEntity(attributeName);
if (refEntity != null) return refEntity.getIdValue();
else return "";
代码示例来源:origin: org.molgenis/molgenis-data-rest
FileMeta entity = (FileMeta) oldEntity.getEntity(attr.getName());
if (entity.get(FILENAME).equals(paramValue)) {
value = entity;
代码示例来源:origin: org.molgenis/molgenis-data-annotators
Entity variantEntity = entity.getEntity(VARIANT);
代码示例来源:origin: org.molgenis/molgenis-fair
case CATEGORICAL:
case FILE:
addRelationForXrefTypeAttribute(model, subject, predicate, objectEntity.getEntity(name));
break;
default:
内容来源于网络,如有侵权,请联系作者删除!