use of jetbrains.exodus.query.metadata.ModelMetaData in project xodus by JetBrains.
the class TreeKeepingEntityIterable method instantiateForWholeHierarchy.
private Iterable<Entity> instantiateForWholeHierarchy(final String entityType, final NodeBase ast) {
final ModelMetaData mmd = queryEngine.getModelMetaData();
@Nullable final EntityMetaData emd = mmd == null ? null : mmd.getEntityMetaData(entityType);
Iterable<Entity> result = (emd != null && emd.isAbstract()) ? EntityIterableBase.EMPTY : ast.getClone().instantiate(entityType, queryEngine, mmd, new NodeBase.InstantiateContext());
if (!(emd == null || ast.polymorphic())) {
for (String subType : emd.getSubTypes()) {
if (Utils.getUnionSubtypes()) {
// union returns sorted by id results provided its operands are sorted by id
result = queryEngine.unionAdjusted(result, instantiateForWholeHierarchy(subType, ast));
} else {
result = queryEngine.concatAdjusted(result, instantiateForWholeHierarchy(subType, ast));
}
}
}
return queryEngine.adjustEntityIterable(result);
}
Aggregations