private Slot<PrimaryKeyMap> addPrimaryKey(FilterLevel filterLevel, ResourceId formId) { Slot<ColumnView> filteredIdSlot = addRecordIdColumn(filterLevel, formId); return new MemoizedSlot<>(filteredIdSlot, new Function<ColumnView, PrimaryKeyMap>() { @Override public PrimaryKeyMap apply(ColumnView columnView) { return columnFactory.newPrimaryKeyMap(columnView); } }); }
break; case RECORD_ID: column = addRecordIdColumn(filterLevel, match.getFormClass().getId()); break; default:
/** * 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()); } } }