use of org.molgenis.data.support.PartialEntity in project molgenis by molgenis.
the class EntityManagerImpl method create.
private Entity create(EntityType entityType, Fetch fetch, CreationMode creationMode) {
Entity entity = new DynamicEntity(entityType);
if (fetch != null) {
// create partial entity that loads attribute values not contained in the fetch on demand.
entity = new PartialEntity(entity, fetch, this);
}
if (entityType.hasAttributeWithExpression()) {
// create entity that computed values based on expressions defined in meta data
entity = new EntityWithComputedAttributes(entity);
}
if (creationMode == POPULATE) {
entityPopulator.populate(entity);
}
EntityFactory<? extends Entity, ?> entityFactory = entityFactoryRegistry.getEntityFactory(entityType);
if (entityFactory != null) {
// create static entity (e.g. Tag, Language, Package) that wraps the constructed dynamic or partial entity.
return entityFactory.create(entity);
}
return entity;
}
Aggregations