类 BeanPropertyRowMapper<T>

  • 所有已实现的接口:
    org.springframework.jdbc.core.RowMapper<T>

    public class BeanPropertyRowMapper<T>
    extends Object
    implements org.springframework.jdbc.core.RowMapper<T>

    将每一行的结果集转换为指定 POJO 类型

    两倍有余 BeanPropertyRowMapper 的性能,对比结果见 官网文档 说明。

    支持更多类型映射,如:JSONObject、JSONArray

    支持 JSONField 注解

    从以下版本开始:
    2020年11月2日
    作者:
    ylyue
    • 构造器详细资料

      • BeanPropertyRowMapper

        public BeanPropertyRowMapper​(Class<T> mappedClass)
        Create a new BeanPropertyRowMapper, accepting unpopulated properties in the target bean.

        Consider using the newInstance(java.lang.Class<T>) factory method instead, which allows for specifying the mapped type once only.

        参数:
        mappedClass - the class that each row should be mapped to
    • 方法详细资料

      • newInstance

        public static <T> BeanPropertyRowMapper<T> newInstance​(Class<T> mappedClass)
        Static factory method to create a new BeanPropertyRowMapper (with the mapped class specified only once).
        参数:
        mappedClass - the class that each row should be mapped to