You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Constructor id arguments don't need to be listed first #2541
I was working on using MyBatis with pre-existing classes and i ran into the problem that according to the DTD idArgs need to come before args in the constructor.
This following example doesn't validate, although MyBatis doesn't actually have this restriction:
<resultMap id="MyClass" type="test.MyClass">
<constructor> <!-- Error: The content of element type "constructor" must match "(idArg*,arg*)". -->
<arg column="name" javaType="string" />
<idArg column="id" javaType="string" />
</constructor>
</resultMap>
Can mybatis-3-mapper.dtd be changed from: <!ELEMENT constructor (idArg*,arg*)>
to <!ELEMENT constructor ((idArg|arg)*)>
Activity
Condor70 commentedon Apr 29, 2022
I just noticed that MyBatis has an XSD as well, which also would need to change:
Current mybatis-mapper.xsd:
New mybatis-mapper.xsd:
harawata commentedon Apr 29, 2022
Hello @Condor70 ,
I didn't know this was possible with DTD.
Would you send us a PR?
If you are busy, please just let me know and I'll take care of it later.
FYI, if you specify
name, the order ofidArg/argdoes not matter.See #721
https://github.com/mybatis/mybatis-3/issues/2541