Table.asList() not working in 1.6-RC2

48 views
Skip to first unread message

MartinAfterDark

unread,
Nov 9, 2016, 5:00:24 AM11/9/16
to sql2o

I am using the work around:

public static List<Map<String, Object>> tableToList(Table t) {
List<Map<String, Object>> mapList = new ArrayList<>();
for (int i = 0; i < t.rows().size(); i++) {
Map<String, Object> map = new HashMap<>();
for (int j = 0; j < t.columns().size(); j++) {
map.put(t.columns().get(j).getName(), t.rows().get(i).getObject(j));
}
mapList.add(map);
}
return mapList;
}


The  table.asList()  function does not work.


Has anyone found a fix?

And should it not be LinkedHasMap to preserve insertion order?

Lars Aaberg

unread,
Nov 13, 2016, 5:17:08 PM11/13/16
to sql2o
I have updated Row.asMap method as proposed in https://github.com/aaberg/sql2o/issues/245. This should fix the issue.

Lars Aaberg

unread,
Nov 13, 2016, 6:30:19 PM11/13/16
to sql2o
I have released version 1.6.0-RC3. Could you check if it works for you with this version?


On Wednesday, November 9, 2016 at 11:00:24 AM UTC+1, MartinAfterDark wrote:

Martin Moghadam

unread,
Nov 13, 2016, 6:31:42 PM11/13/16
to sq...@googlegroups.com

Sure. I'll try it.


--
You received this message because you are subscribed to a topic in the Google Groups "sql2o" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/sql2o/-Z7p7eVhEQc/unsubscribe.
To unsubscribe from this group and all its topics, send an email to sql2o+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

MartinAfterDark

unread,
Nov 14, 2016, 1:33:38 AM11/14/16
to sql2o
It works. Looks good.

Thx.
Reply all
Reply to author
Forward
0 new messages