Skip to content

Commit

Permalink
[QueryDetail]
Browse files Browse the repository at this point in the history
-add columns in xml if are not present, so all columns are returned and showed to the client
  • Loading branch information
alecones committed Jun 20, 2016
1 parent d9a1bd1 commit 1572c3d
Showing 1 changed file with 13 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -798,6 +798,19 @@ private String getLovResult(IEngUserProfile profile, String statement) throws Ex
dataResult = sqlCommand.execute();
ScrollableDataResult scrollableDataResult = (ScrollableDataResult) dataResult.getDataObject();
SourceBean result = scrollableDataResult.getSourceBean();

List<String> colNames = Arrays.asList(scrollableDataResult.getColumnNames());
List rows = result.getAttributeAsList(DataRow.ROW_TAG);
//insert all the columns name in the first row, so after all the columns will be present and returned to the client
if (rows.size() > 0){
SourceBean rowBean = (SourceBean) rows.get(0);
for (int i = 0 ; i < colNames.size(); i++){
String col = colNames.get(i).toString();
if (!rowBean.containsAttribute(col)){
rowBean.setAttribute(col, "");
}
}
}
resStr = result.toXML(false);
resStr = resStr.trim();
if (resStr.startsWith("<?")) {
Expand Down

0 comments on commit 1572c3d

Please sign in to comment.