DTD MyBatis · 3

MyBatis 3 mapper

MyBatis mapper XML files: SQL statements, result maps and dynamic SQL.

About

A mapper file pairs SQL with a Java interface. The DTD checks the statement elements, result maps and dynamic SQL tags (if, choose, foreach).

Good to know

  • SQL text is not parsed, and type and property names are not checked against Java classes.
  • The example is by xmlvalid.com.

Files

1 file · 7.3 KB

Example document

UserMapper.xml · 1 KB · valid against this schema

In CI and from code

The same schema by its name, mybatis-3-mapper, through the API.

npx @xmlvalid/cli validate "**/*.xml" --schema mybatis-3-mapper
- uses: xmlvalid/validate-action@v1
  with:
    files: "**/*.xml"
    schema: mybatis-3-mapper
    api-key: ${{ secrets.XMLVALID_API_KEY }}
curl https://xmlvalid.com/api/v1/validations \
  -H "Authorization: Bearer $XMLVALID_API_KEY" \
  -F document={{ $schema->example ?? 'document.xml' }} -F schema=mybatis-3-mapper

Free accounts get 100 API validations a month. On Pro, a URL monitor can check a published document against this schema every hour and email you when it breaks. More CI setups