Skip to main content
Hint

This article is generated by AI translation.

Document

Mapper files are stored as XML. The basic structure is:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//dbvisitor.net//DTD Mapper 1.0//EN"
"https://www.dbvisitor.net/schema/dbvisitor-mapper.dtd">
<mapper namespace="...">
...
</mapper>

Attributes

PropertyDescription
namespace必选 Usually the fully qualified mapper interface name; each method maps to a SQL operation in this file.
caseInsensitive可选 Case-insensitive matching for column/property names. Default true. Handy when drivers return uppercase cols.
mapUnderscoreToCamelCase可选 Convert camelCase properties to snake_case column names (e.g., createTimecreate_time). Default false.
autoMapping可选 Enable auto-mapping. Default true.
useDelimited可选 (v5.3.4+) Force quoting/delimiters on table/column names when generating SQL. Default false.

Elements

Top-level XML elements under the root:

Validate the document

Use XML DTD or XML Schema to validate mapper XML.

Example: validate with DTD
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//dbvisitor.net//DTD Mapper 1.0//EN"
"https://www.dbvisitor.net/schema/dbvisitor-mapper.dtd">
<mapper namespace="...">
...
</mapper>
Example: validate with XML Schema
<?xml version="1.0" encoding="UTF-8"?>
<mapper xmlns="https://www.dbvisitor.net/schema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="https://www.dbvisitor.net/schema https://www.dbvisitor.net/schema/dbvisitor-mapper.xsd"
namespace="...">
...
</mapper>