|
This post originated from an RSS feed registered with Agile Buzz
by Ryan Ransford.
|
Original Post: Spring Note: RowMapper/MappingSqlQuery
Feed Title: Active-Active Configuration
Feed URL: http://active-active.blogspot.com/feeds/posts/default
Feed Description: Active-Active Configuration is a blog about making my place in the enterprise world better. This blog is primarily focused on Java articles, but be prepared to be challenged by posts about dynamic languages, agile tools, and the lighter side of geek culture.
|
Latest Agile Buzz Posts
Latest Agile Buzz Posts by Ryan Ransford
Latest Posts From Active-Active Configuration
|
|
RowMapper
The RowMapper class is an interface which defines only one method which turns a single row from a ResultSet into a domain-useable object. While you can use a generic implementation of this class for producing column name/value Maps, my typical usage has been to create domain objects from the result of a specific set of queries.
MappingSqlQuery
The MappingSqlQuery class is intended to be used for SELECT queries and can use a RowMapper implementation to create a result List of the appropriate type, hiding the intermediate ResultSet from the outside world.
These classes, when taken together, provide excellent tools for creating the read methods for DAO classes which are concise and testable.
ITSpringJdbc.java
ITSpringJdbc-context.xml
select dummy from table where dummy = ?
]]>
Read: Spring Note: RowMapper/MappingSqlQuery