@Override public void toString(Map<Object, Object> params, StringBuilder builder) { if (items == null) { return; } boolean first = true; if (distinct) { builder.append("DISTINCT "); } // print * before for (OProjectionItem item : items) { if (item.isAll()) { if (!first) { builder.append(", "); } item.toString(params, builder); first = false; } } // and then the rest of the projections for (OProjectionItem item : items) { if (!item.isAll()) { if (!first) { builder.append(", "); } item.toString(params, builder); first = false; } } }
if (info.orderApplied || info.expand || info.unwind != null || info.orderBy == null || info.orderBy.getItems().size() == 0 || info.projection == null || info.projection.getItems() == null || (info.projection.getItems().size() == 1 && info.projection.getItems().get(0).isAll())) { return;
private void validateStatement(OSelectStatement statement) { if (statement.getProjection() != null) { if (statement.getProjection().getItems().size() > 1) { throw new OCommandExecutionException("Projections cannot be used in live query " + statement); } else if (statement.getProjection().getItems().get(0).isAll()) { throw new OCommandExecutionException("Projections cannot be used in live query " + statement); } } if (statement.getTarget().getItem().getIdentifier() == null && statement.getTarget().getItem().getRids() == null) { throw new OCommandExecutionException("Live queries can only be executed against a Class or on RIDs" + statement); } if (statement.getOrderBy() != null) { throw new OCommandExecutionException("Live queries do not support ORDER BY " + statement); } if (statement.getGroupBy() != null) { throw new OCommandExecutionException("Live queries do not support GROUP BY " + statement); } if (statement.getSkip() != null || statement.getLimit() != null) { throw new OCommandExecutionException("Live queries do not support SKIP/LIMIT " + statement); } }