Example usage for org.apache.ibatis.session SqlSession selectMap

List of usage examples for org.apache.ibatis.session SqlSession selectMap

Introduction

In this page you can find the example usage for org.apache.ibatis.session SqlSession selectMap.

Prototype

<K, V> Map<K, V> selectMap(String statement, Object parameter, String mapKey, RowBounds rowBounds);

Source Link

Document

The selectMap is a special case in that it is designed to convert a list of results into a Map based on one of the properties in the resulting objects.

Usage

From source file:net.hasor.db.orm.mybatis3.SqlExecutorTemplate.java

License:Apache License

public <K, V> Map<K, V> selectMap(final String statement, final Object parameter, final String mapKey,
        final RowBounds rowBounds) throws SQLException {
    return this.execute(new SqlSessionCallback<Map<K, V>>() {
        public Map<K, V> doSqlSession(SqlSession sqlSession) {
            return sqlSession.selectMap(statement, parameter, mapKey, rowBounds);
        }// ww w . j a  v a2s. co  m
    });
}