@Override public Slot<ColumnView> visitConstant(ConstantNode node) { return batch.addConstantColumn(filterLevel, rootFormClass, node.getValue()); }
/** * Adds a query to the batch for a column derived from a single node within the FormTree, along * with any necessary join structures required to join this column to the base table, if the column * is nested. * * @return a ColumnView Slot that can be used to retrieve the result after the batch * has finished executing. */ public Slot<ColumnView> addColumn(FilterLevel filterLevel, NodeMatch match) { if (match.isJoined()) { // requires join return addJoinedColumn(filterLevel, match); } else { // form label column, id column, simple root column or embedded form switch (match.getType()) { case FORM_NAME: return addConstantColumn(filterLevel, match.getFormClass(), match.getFormClass().getLabel()); case RECORD_ID: return addRecordIdColumn(filterLevel, match.getFormClass().getId()); case FORM_ID: return addConstantColumn(filterLevel, match.getFormClass(), match.getFormClass().getId().asString()); case FIELD: return getDataColumn(filterLevel, match.getFormClass().getId(), match.getFieldComponent()); default: throw new UnsupportedOperationException("Type: " + match.getType()); } } }