Class DataClassRowMapper<T>

java.lang.Object
org.springframework.jdbc.core.BeanPropertyRowMapper<T>
org.springframework.jdbc.core.DataClassRowMapper<T>
Type Parameters:
T - the result type
All Implemented Interfaces:
RowMapper<T>

public class DataClassRowMapper<T> extends BeanPropertyRowMapper<T>
RowMapper implementation that converts a row into a new instance of the specified mapped target class. The mapped target class must be a top-level class and may either expose a data class constructor with named parameters corresponding to column names or classic bean property setters (or even a combination of both).

Note that this class extends BeanPropertyRowMapper and can therefore serve as a common choice for any mapped target class, flexibly adapting to constructor style versus setter methods in the mapped class.

Since:
5.3
Author:
Juergen Hoeller