}
private CDEResult addConstFields(CDEResult res,
List<QueryElement> constFlds) {
CDEResult newRes = res;
if (constFlds != null && constFlds.size() > 0) {
if (res == null
|| (res != null && (res.getRows() == null || (res.getRows() != null && res
.getRows().size() == 0)))) {
newRes = new CDEResult();
// add one row
newRes.getRows().add(new CDERow());
}
for (Iterator<QueryElement> i = constFlds.iterator(); i.hasNext();) {
QueryElement elem = i.next();
MappingField fld = this.mapping.getFieldByLocalName(elem
.getValue());
for (Iterator<CDERow> j = newRes.getRows().iterator(); j
.hasNext();) {
CDERow row = j.next();
CDEValue val = new CDEValue(fld.getName(), fld
.getConstantValue());
row.getVals().add(val);