Uploaded image for project: 'iBatis for .NET'
  1. iBatis for .NET
  2. IBATISNET-45

Unable to reference result maps defined in other xml files when useStatementNamespaces is set to true

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • None
    • DataMapper 1.2.0
    • None
    • None
    • DataMapper: 1.1.458.0

    Description

      If I try to access a result map in a different namespace using this syntax:

      <sqlMap namespace="XYZ" ...>
      <statements>
      <select id="GetMany" resultMap="ABC.FooResult" parameterClass="map">

      I get an exception complaining that resultMap XYZ.ABC.FooResult is not defined. ABC.FooResult is defined in a seperate xml file. In my SqlMap.config file, the xml file containing ABC.FooResult appears before the XYZ resultmap file:

      <sqlMaps>
      <sqlMap resource="ABC.xml" />
      <sqlMap resource="XYZ.xml" />
      </sqlMaps>

      Java people in the #ibatis chatroom (Brandon and Larry) said that to reference a external result map, you needed to do so before the id tag:

      <sqlMap namespace="XYZ" ...>
      <statements>
      <select resultMap="ABC.FooResult" id="GetMany" parameterClass="map">

      That didn't work in IBatisNet.

      I also tried creating a local resultmap that extended an external resultmap:

      <sqlMap namespace="XYZ" ...>
      <resultMaps>
      <resultMap id="FooResult" extends="ABC.FooResult" />
      </resultMaps>
      <statements>
      <select id="GetMany" resultMap="FooResult" parameterClass="map">

      I received an exception saying something about ABC.FooResult not being found.

      Attachments

        Activity

          People

            gilles Gilles Bayon
            ron liu ron
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: