Results container/RowMap
https://gyazo.com/89f6a1fa04b59cb92048986e10832005 https://gyazo.com/ed6df50c3b2e854f351aa2a1327e18ad #Core #Results_container #Container_(sorm4j.container)
RowMap instances can be used as Results container. Results container/RowMap extends Map<String, Object>.
Sorm could convert a row in SQL result to a RowMap object.
The types of values are depending on JDBC type. > Results container/Supported types
The keys of the map are the canonical names of the columns returned from the database.
code:Mapping SQL results to java.util.Map example.java
// reads a customer using a custom query and return the result as a map
RowMap customerMap = sorm.readOne(RowMap.class, "select * from customer where id=?", 10); //=> {ID=10, NAME="Alice"}
// reads all customers and result the results as Map instances in a List
List<RowMap> customerMapList = sorm.readList(RowMap.class, "select * from customer"); //=> {ID=10, NAME="Alice"},{ID=11, NAME="Bob"}