Uploaded image for project: 'iBatis for Java [READ ONLY]'
  1. iBatis for Java [READ ONLY]
  2. IBATIS-758

resultMap don't work in collection element

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Critical
    • Resolution: Invalid
    • 3.0 Beta 10
    • None
    • Core
    • None
    • java 1.6 db Oracle

    Description

      <resultMap id="watchpointResults" type="ru.bo.documents.Watchpoint">
      <id property="id" column="MONITORING_POINT_ID"/>
      <result property="name" column="MONITORING_POINT_NAME"/>
      <collection property="okspps" column="MP_OKSPP_LIST" typeHandler="handlers.CursorHandler"/> //work and return HashMap
      <collection property="okspps" column="MP_OKSPP_LIST" resultMap="oksppResults"/> //don't work and return null
      </resultMap>

      <resultMap id="oksppResults" type="ru.bo.documents.OKSPP">
      <id property="code" column="OKSPP_CODE"/>
      <result property="name" column="OKSPP_NAME"/>
      </resultMap>

      in FastResultSetHandler.getPropertyMappingValue handl two cases nested select or typeHandler

      protected Object getPropertyMappingValue(ResultSet rs, MetaObject metaResultObject, ResultMapping propertyMapping, ResultLoaderMap lazyLoader) throws SQLException {
      final TypeHandler typeHandler = propertyMapping.getTypeHandler();
      if (propertyMapping.getNestedQueryId() != null)

      { return getNestedQueryMappingValue(rs, metaResultObject, propertyMapping, lazyLoader); }

      else if (typeHandler != null)

      { final String column = propertyMapping.getColumn(); return typeHandler.getResult(rs, column); }

      return null;
      }

      Attachments

        Activity

          People

            cbegin Clinton Begin
            ziman200 Sergey Zimbovskiy
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: