result set

This commit is contained in:
jackdaw@loafle.com 2017-04-25 16:29:33 +09:00
parent a6e8828bfd
commit 4501f9eac4

View File

@ -41,7 +41,29 @@ public class OFResultSet {
} }
public void setMeta(List<String> meta) { public void setMeta() {
String type = (String) this.item.getQuery().getQueryInfo().get("parseDirection");
List<String> meta = new ArrayList<>();
if (type.equals("row")) {
List<String> arrayColumns = (List<String>) this.item.getQuery().getQueryInfo().get("arrayColumns");
List<String> keyColumns = (List<String>) this.item.getQuery().getQueryInfo().get("keyColumns");
String valueColumn = (String) this.item.getQuery().getQueryInfo().get("valueColumn");
for (String c : arrayColumns) {
meta.add(c);
}
for (String c: keyColumns) {
meta.add(c);
}
meta.add(valueColumn);
} else {
}
if(this.meta == null) { if(this.meta == null) {
this.meta = new HashMap<>(); this.meta = new HashMap<>();
@ -54,13 +76,9 @@ public class OFResultSet {
} }
public OFResultSet(Item item) { public OFResultSet(Item item) {
this(item,null);
}
public OFResultSet(Item item,List<String> meta) {
this.item = item; this.item = item;
this.rows = new ArrayList<>(); this.rows = new ArrayList<>();
this.setMeta(meta); this.setMeta();
} }
public void addRow(List<String> row) { public void addRow(List<String> row) {