Kemal Sokolovic wrote:Though I have no idea why you would want to do something like that... Database contains structured data (or at least it should), and storing data in maps by column name doesn't sound so reasonable to me.
Actually for some use cases it is the most reasonable and better way.
Let me give you an exact instance.
I had a Charting UI component to make a Pie chart. To determine the pie slices names and size the component wanted a Map, where the key is the pie slice name and the value was the size. Why go to the database, get a ResultSet, have to convert it to a Domain object to pass up to the UI layer, then write code to convert the domain object into a Map. Why not query for that Map at the DAO layer with one line of code, and just pass the Map up to the client.
Mark