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

Using mode=OUT leads to "ClassNotFoundException: Cannot find class: OUT"

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 3.0 Beta 6, 3.0 Beta 7
    • 3.0 Beta 8
    • Core
    • None
    • Oracle 11, JDK 1.6, iBATIS 3.0 Beta 7 (Build 216)

    Description

      The insert statement

      <insert id="insertRegion" parameterType="Region">
      BEGIN
      INSERT INTO REGIONS (REGION_ID, REGION_NAME) VALUES (5, #

      {regionName}

      )
      RETURNING REGION_ID INTO #

      {regionId,mode=OUT}

      ;
      END;
      </insert>

      Leads to

      Exception in thread "main" org.apache.ibatis.exceptions.IbatisException:

          1. Error updating database. Cause: org.apache.ibatis.type.TypeException: Could not resolve type alias 'OUT'. Cause: java.lang.ClassNotFoundException: Cannot find class: OUT
          2. The error may exist in test1/Mapper.xml
          3. The error may involve test1.Mapper.insertRegion
          4. The error occurred while executing an update
          5. Cause: org.apache.ibatis.type.TypeException: Could not resolve type alias 'OUT'. Cause: java.lang.ClassNotFoundException: Cannot find class: OUT
            at org.apache.ibatis.exceptions.ExceptionFactory.wrapException(ExceptionFactory.java:8)
            at org.apache.ibatis.session.defaults.DefaultSqlSession.update(DefaultSqlSession.java:95)
            at org.apache.ibatis.session.defaults.DefaultSqlSession.insert(DefaultSqlSession.java:82)

      The cause seems to be in BaseBuilder.resolveParameterMode(String alias), where the line

      return ParameterMode.valueOf(resolveAlias(alias).getName());

      should actually be something like

      return ParameterMode.valueOf(alias);

      Attachments

        Activity

          People

            cbegin Clinton Begin
            abaecker Andreas Baecker
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: