use of com.developmentontheedge.beans.DynamicPropertySetSupport in project be5 by DevelopmentOnTheEdge.
the class Be5QueryExecutor method executeSubQuery.
@Override
public List<DynamicPropertySet> executeSubQuery(String subqueryName, CellFormatter.VarResolver varResolver) {
AstBeSqlSubQuery subQuery = contextApplier.applyVars(subqueryName, varResolver::resolve);
if (subQuery.getQuery() == null) {
return Collections.emptyList();
}
String finalSql = new Formatter().format(subQuery.getQuery(), context, parserContext);
List<DynamicPropertySet> dynamicPropertySets;
try {
dynamicPropertySets = listDps(finalSql);
} catch (Throwable e) {
// TODO only for Document presentation, for operations must be error throw
Be5Exception be5Exception = Be5Exception.internalInQuery(e, query);
log.log(Level.SEVERE, be5Exception.toString() + " Final SQL: " + finalSql, be5Exception);
DynamicPropertySetSupport dynamicProperties = new DynamicPropertySetSupport();
dynamicProperties.add(new DynamicProperty("___ID", String.class, "-1"));
dynamicProperties.add(new DynamicProperty("error", String.class, UserInfoHolder.isSystemDeveloper() ? Be5Exception.getMessage(e) : "error"));
dynamicPropertySets = Collections.singletonList(dynamicProperties);
}
// return Collections.singletonList(dynamicProperties);
return dynamicPropertySets;
}
use of com.developmentontheedge.beans.DynamicPropertySetSupport in project be5 by DevelopmentOnTheEdge.
the class EntityModelBase method add.
@Override
public String add(Map<String, ? super Object> values) {
Objects.requireNonNull(values);
DynamicPropertySet dps = new DynamicPropertySetSupport();
dpsHelper.addDpForColumnsWithoutTags(dps, entity, values.keySet(), values);
return add(dps);
}
use of com.developmentontheedge.beans.DynamicPropertySetSupport in project be5 by DevelopmentOnTheEdge.
the class EntityModelBase method set.
@Override
public int set(String id, Map<String, ? super Object> values) {
Objects.requireNonNull(id);
Objects.requireNonNull(values);
DynamicPropertySet dps = new DynamicPropertySetSupport();
dpsHelper.addDpForColumnsWithoutTags(dps, entity, values.keySet(), values);
return this.set(id, dps);
}
use of com.developmentontheedge.beans.DynamicPropertySetSupport in project be5 by DevelopmentOnTheEdge.
the class EntityModelBase method getColumns.
@Override
public RecordModel getColumns(List<String> columns, Map<String, ? super Object> conditions) {
Objects.requireNonNull(conditions);
AstSelect sql = Ast.select(addPrimaryKeyColumnIfNotEmpty(columns)).from(entity.getName()).where(conditions);
DynamicPropertySet dps = db.select(sql.format(), rs -> {
DynamicPropertySet newDps = new DynamicPropertySetSupport();
dpsHelper.addDpWithoutTags(newDps, entity, rs);
return newDps;
}, conditions.values().toArray());
return dps == null ? null : new RecordModelBase(this, dps);
}
use of com.developmentontheedge.beans.DynamicPropertySetSupport in project be5 by DevelopmentOnTheEdge.
the class FilterByParamsInQueryOperation method getParameters.
@Override
public Object getParameters(Map<String, Object> presetValues) throws Exception {
DynamicPropertySet dps = new DynamicPropertySetSupport();
dpsHelper.addParamsFromQuery(dps, getInfo().getModel(), getQuery());
return filterHelper.processFilterParams(dps, presetValues, context.getOperationParams());
}
Aggregations