Class ResultSetWrapper


  • public class ResultSetWrapper
    extends java.lang.Object
    • Field Detail

      • resultSet

        private final java.sql.ResultSet resultSet
      • columnNames

        private final java.util.List<java.lang.String> columnNames
      • classNames

        private final java.util.List<java.lang.String> classNames
      • jdbcTypes

        private final java.util.List<JdbcType> jdbcTypes
      • typeHandlerMap

        private final java.util.Map<java.lang.String,​java.util.Map<java.lang.Class<?>,​TypeHandler<?>>> typeHandlerMap
      • mappedColumnNamesMap

        private final java.util.Map<java.lang.String,​java.util.List<java.lang.String>> mappedColumnNamesMap
      • unMappedColumnNamesMap

        private final java.util.Map<java.lang.String,​java.util.List<java.lang.String>> unMappedColumnNamesMap
    • Constructor Detail

      • ResultSetWrapper

        public ResultSetWrapper​(java.sql.ResultSet rs,
                                Configuration configuration)
                         throws java.sql.SQLException
        Throws:
        java.sql.SQLException
    • Method Detail

      • getResultSet

        public java.sql.ResultSet getResultSet()
      • getColumnNames

        public java.util.List<java.lang.String> getColumnNames()
      • getClassNames

        public java.util.List<java.lang.String> getClassNames()
      • getJdbcTypes

        public java.util.List<JdbcType> getJdbcTypes()
      • getJdbcType

        public JdbcType getJdbcType​(java.lang.String columnName)
      • getTypeHandler

        public TypeHandler<?> getTypeHandler​(java.lang.Class<?> propertyType,
                                             java.lang.String columnName)
        Gets the type handler to use when reading the result set. Tries to get from the TypeHandlerRegistry by searching for the property type. If not found it gets the column JDBC type and tries to get a handler for it.
        Parameters:
        propertyType - the property type
        columnName - the column name
        Returns:
        the type handler
      • resolveClass

        private java.lang.Class<?> resolveClass​(java.lang.String className)
      • loadMappedAndUnmappedColumnNames

        private void loadMappedAndUnmappedColumnNames​(ResultMap resultMap,
                                                      java.lang.String columnPrefix)
                                               throws java.sql.SQLException
        Throws:
        java.sql.SQLException
      • getMappedColumnNames

        public java.util.List<java.lang.String> getMappedColumnNames​(ResultMap resultMap,
                                                                     java.lang.String columnPrefix)
                                                              throws java.sql.SQLException
        Throws:
        java.sql.SQLException
      • getUnmappedColumnNames

        public java.util.List<java.lang.String> getUnmappedColumnNames​(ResultMap resultMap,
                                                                       java.lang.String columnPrefix)
                                                                throws java.sql.SQLException
        Throws:
        java.sql.SQLException
      • getMapKey

        private java.lang.String getMapKey​(ResultMap resultMap,
                                           java.lang.String columnPrefix)
      • prependPrefixes

        private java.util.Set<java.lang.String> prependPrefixes​(java.util.Set<java.lang.String> columnNames,
                                                                java.lang.String prefix)