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

circular reference in resultMap for join select - StackOverflowError

    XMLWordPrintableJSON

Details

    • New Feature
    • Status: Open
    • Major
    • Resolution: Unresolved
    • 3.0 Beta 10
    • None
    • Core
    • None

    Description

      I created circular reference (feeGroup.fees -> fee.feeGroup -> feeGroup.fees) in resultMap for join select but I got StackOverflowError. It seems that circular references work only for lazy loading?

      ----------------------------------------------------------------------------------------

      <?xml version="1.0" encoding="UTF-8"?>
      <!DOCTYPE mapper PUBLIC "-//ibatis.apache.org//DTD iBatis Mapper 3.0 //EN" "http://ibatis.apache.org/dtd/ibatis-3-mapper.dtd">
      <mapper namespace="mapper.FeeGroup">

      <resultMap id="map" type="model.FeeGroup">
      <id property="id" column="FEE_GROUPS_1" />
      <result property="name" column="FEE_GROUPS_2" />
      <result property="valid" column="FEE_GROUPS_3" />
      <collection property="fees" resultMap="mapper.Fee.map" />
      </resultMap>

      <select id="getByWithTables" parameterType="java.util.Map" resultMap="map">
      select
      FEES.ID as FEES_1,
      FEES.ID_FEE_GROUP as FEES_2,
      FEES.PRICE_SELLER as FEES_3,
      FEES.PRICE_CALL_CENTRUM as FEES_4,
      FEES.PRICE_OPERATOR as FEES_5,
      FEES.VALID_FROM as FEES_6,
      FEES.VALID_TO as FEES_7,
      FEES.MAX_OPERATOR_MEETING as FEES_8,
      FEE_GROUPS.ID as FEE_GROUPS_1,
      FEE_GROUPS.NAME as FEE_GROUPS_2,
      FEE_GROUPS.VALID as FEE_GROUPS_3
      from
      FEE_GROUPS,
      FEES
      where
      FEE_GROUPS.ID = #

      {id}

      and
      FEES.ID_FEE_GROUP = FEE_GROUPS.ID
      order by
      FEE_GROUPS.VALID desc, FEE_GROUPS.NAME, FEES.VALID_FROM desc
      </select>

      </mapper>

      ----------------------------------------------------------------------------------------

      <?xml version="1.0" encoding="UTF-8"?>
      <!DOCTYPE mapper PUBLIC "-//ibatis.apache.org//DTD iBatis Mapper 3.0 //EN" "http://ibatis.apache.org/dtd/ibatis-3-mapper.dtd">
      <mapper namespace="mapper.Fee">

      <resultMap id="map" type="model.Fee">
      <id property="id" column="FEES_1" />
      <result property="idFeeGroup" column="FEES_2" />
      <result property="priceSeller" column="FEES_3" />
      <result property="priceCallCentrum" column="FEES_4" />
      <result property="priceOperator" column="FEES_5" />
      <result property="validFrom" column="FEES_6" />
      <result property="validTo" column="FEES_7" />
      <result property="maxOperatorMeeting" column="FEES_8" />
      <association property="feeGroup" resultMap="mapper.FeeGroup.map" />
      </resultMap>

      </mapper>

      Attachments

        Activity

          People

            Unassigned Unassigned
            libtom Libor Tomáš
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated: