Skip to content

Commit

Permalink
Fix nested projections to support *:{*}
Browse files Browse the repository at this point in the history
Resolves: #8724
  • Loading branch information
luigidellaquila committed Jan 17, 2019
1 parent 461a6d1 commit 3fc6ecf
Showing 1 changed file with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -99,17 +99,18 @@ public OResult calculateSingle(OCommandContext iContext, OResult iRecord) {
for (OProjectionItem item : items) {
if (item.isAll()) {
for (String alias : iRecord.getPropertyNames()) {
result.setProperty(alias, item.convert(iRecord.getProperty(alias)));
Object val = item.convert(iRecord.getProperty(alias));
if (item.nestedProjection != null) {
val = item.nestedProjection.apply(item.expression, val, iContext);
}
result.setProperty(alias, val);
}
if (iRecord.getElement().isPresent()) {
OElement x = iRecord.getElement().get();
result.setProperty("@rid", x.getIdentity());
result.setProperty("@version", x.getVersion());
result.setProperty("@class", x.getSchemaType().map(clazz -> clazz.getName()).orElse(null));
}
if (item.nestedProjection != null) {
result = (OResultInternal) item.nestedProjection.apply(item.expression, result, iContext);
}
} else {
result.setProperty(item.getProjectionAliasAsString(), item.execute(iRecord, iContext));
}
Expand Down

0 comments on commit 3fc6ecf

Please sign in to comment.