use of org.activityinfo.model.query.ColumnModel in project activityinfo by bedatadriven.
the class DefaultQueryBuilder method build.
public QueryModel build() {
LOGGER.info("No query fields provided, querying all.");
addFields("", new FieldPath(), tree.getRootFields());
this.queryModel = new QueryModel(tree.getRootFormId());
this.queryModel.selectResourceId().as("@id");
for (ColumnModel columnModel : columns.values()) {
this.queryModel.addColumn(columnModel);
}
return queryModel;
}
use of org.activityinfo.model.query.ColumnModel in project activityinfo by bedatadriven.
the class GeoPointFormat method getColumnModels.
@Override
public List<ColumnModel> getColumnModels() {
ColumnModel latitudeModel = new ColumnModel();
latitudeModel.setId(getLatitudeId());
latitudeModel.setFormula(new CompoundExpr(formula, new SymbolNode("latitude")));
ColumnModel longitudeModel = new ColumnModel();
longitudeModel.setId(getLongitudeId());
longitudeModel.setFormula(new CompoundExpr(formula, new SymbolNode("longitude")));
return Arrays.asList(latitudeModel, longitudeModel);
}
use of org.activityinfo.model.query.ColumnModel in project activityinfo by bedatadriven.
the class MultiEnumFormat method getColumnModels.
@Override
public List<ColumnModel> getColumnModels() {
List<ColumnModel> columns = new ArrayList<>();
for (EnumItem enumItem : enumType.getValues()) {
ColumnModel model = new ColumnModel();
model.setId(getItemId(enumItem));
model.setFormula(new CompoundExpr(formula, new SymbolNode(enumItem.getId())));
columns.add(model);
}
return columns;
}
use of org.activityinfo.model.query.ColumnModel in project activityinfo by bedatadriven.
the class SimpleColumnFormat method getColumnModels.
@Override
public final List<ColumnModel> getColumnModels() {
ColumnModel columnModel = new ColumnModel();
columnModel.setId(id);
columnModel.setFormula(formula);
return Collections.singletonList(columnModel);
}
use of org.activityinfo.model.query.ColumnModel in project activityinfo by bedatadriven.
the class AdminDimBinding method getColumnQuery.
@Override
public List<ColumnModel> getColumnQuery(FormTree formTree) {
ResourceId levelClassId = adminLevelFormClass(model.getLevelId());
Optional<FormClass> adminClass = formTree.getFormClassIfPresent(levelClassId);
if (adminClass.isPresent()) {
ColumnModel id = new ColumnModel();
id.setFormula(new CompoundExpr(levelClassId, ColumnModel.ID_SYMBOL));
id.setId(idColumn);
ColumnModel label = new ColumnModel();
label.setFormula(new FieldPath(levelClassId, field(levelClassId, NAME_FIELD)));
label.setId(labelColumn);
return Arrays.asList(id, label);
} else {
return Collections.emptyList();
}
}
Aggregations