类 ColumnMapRowMapper

  • 所有已实现的接口:
    org.springframework.jdbc.core.RowMapper<com.alibaba.fastjson.JSONObject>

    public class ColumnMapRowMapper
    extends Object
    implements org.springframework.jdbc.core.RowMapper<com.alibaba.fastjson.JSONObject>
    参考 ColumnMapRowMapper,替换为 fastjson 的 JSONObject
    从以下版本开始:
    2020年11月2日
    作者:
    ylyue
    • 构造器详细资料

      • ColumnMapRowMapper

        public ColumnMapRowMapper()
    • 方法详细资料

      • mapRow

        public com.alibaba.fastjson.JSONObject mapRow​(ResultSet rs,
                                                      int rowNum)
                                               throws SQLException
        指定者:
        mapRow 在接口中 org.springframework.jdbc.core.RowMapper<com.alibaba.fastjson.JSONObject>
        抛出:
        SQLException
      • createColumnMap

        protected com.alibaba.fastjson.JSONObject createColumnMap​(int columnCount)
        Create a Map instance to be used as column map.

        By default, a linked case-insensitive Map will be created.

        参数:
        columnCount - the column count, to be used as initial capacity for the Map
        返回:
        the new Map instance
        另请参阅:
        LinkedCaseInsensitiveMap
      • getColumnKey

        protected String getColumnKey​(String columnName)
        Determine the key to use for the given column in the column Map.
        参数:
        columnName - the column name as returned by the ResultSet
        返回:
        the column key to use
        另请参阅:
        ResultSetMetaData.getColumnName(int)
      • getColumnValue

        @Nullable
        protected Object getColumnValue​(ResultSet rs,
                                        int index)
                                 throws SQLException
        Retrieve a JDBC object value for the specified column.

        The default implementation uses the getObject method. Additionally, this implementation includes a "hack" to get around Oracle returning a non standard object for their TIMESTAMP datatype.

        参数:
        rs - is the ResultSet holding the data
        index - is the column index
        返回:
        the Object returned
        抛出:
        SQLException
        另请参阅:
        JdbcUtils.getResultSetValue(java.sql.ResultSet, int, java.lang.Class<?>)