Skip to content

When <result> is converted to <association>, the <association> is not at the end #8

Open
@ooizj

Description

@ooizj

I have a problem:When <result select=""> is converted to <association>, the <association> is not at the end

source

<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE sqlMap PUBLIC "-//iBATIS.com//DTD SQL Map 2.0//EN"
    "sql-map-2.dtd">

<sqlMap namespace="ns1">
	
	<resultMap id="rm1" class="a.b.T1">
		<result column="ID" property="id" jdbcType="DECIMAL" />
		<result column="AID" property="aid" select="ns2.s1" />
		<result column="NAME" property="name" jdbcType="VARCHAR2" />
	</resultMap>

</sqlMap>

destination

<?xml version="1.0" encoding="UTF-8"?><!--Converted at: Tue Jan 26 14:03:48 CST 2021-->
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" 
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="ns1">
	
	<resultMap id="rm1" type="a.b.T1">
		<result property="id" column="ID" jdbcType="DECIMAL"/>
		<association property="aid" select="ns2.s1" column="AID"/>
		<result property="name" column="NAME" jdbcType="VARCHAR2"/>
	</resultMap>

</mapper>

output

PS C:\download\ibatis2mybatis-master> ant
Buildfile: build.xml

migrateToMyBatis3:
     [xslt] Transforming into C:\download\ibatis2mybatis-master\destination
     [xslt] Processing C:\download\ibatis2mybatis-master\source\TestMap.xml to C:\download\ibatis2mybatis-master\destination\TestMap.xml
     [xslt] Loading stylesheet C:\download\ibatis2mybatis-master\migrate.xslt
     [xslt] Warning: org.apache.xerces.jaxp.SAXParserImpl$JAXPSAXParser: Property 'http://javax.xml.XMLConstants/property/accessExternalDTD' is not recognized.
     [xslt] Warning: org.apache.xerces.jaxp.SAXParserImpl$JAXPSAXParser: Property 'http://www.oracle.com/xml/jaxp/properties/entityExpansionLimit' is not recognized.
[xmlvalidate] C:\download\ibatis2mybatis-master\destination\TestMap.xml:10:14: The content of element type "resultMap" must match "(constructor?,id*,result*,association*,collection*,discriminator?)".

BUILD FAILED
C:\download\ibatis2mybatis-master\build.xml:46: C:\download\ibatis2mybatis-master\destination\TestMap.xml is not a valid XML document.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions