This article is generated by AI translation.
Result Processing Rules
This chapter introduces how to use rules for post-processing query results, and auxiliary rules used in complex scenarios such as stored procedures. These rules themselves do not affect SQL generation; they only guide dbVisitor on how to map the returned data.
| Rule | Description |
|---|---|
@{resultSet} | Configure result set mapping strategy (for stored procedures/multiple result sets). |
@{resultUpdate} | Mark a result as an update count (not a result set). |
@{defaultResult} | Configure default result set mapping strategy. |
RESULTSET Rule
In Stored Procedure or Multiple Result Set Query scenarios, guides dbVisitor on how to map the returned result sets.
Syntax:
@{resultSet, key1 = value1, key2 = value2}
Supported Scenarios:
Property Description:
| Name | Type | Description |
|---|---|---|
name | String | Name of the OUT parameter in the result set. |
javaType | Class | Map the result set to a Java type. See Object Mapping. |
rowMapper | RowMapper | Use custom RowMapper to handle mapping. |
rowHandler | RowCallbackHandler | Use custom RowCallbackHandler to handle each row. |
extractor | ResultSetExtractor | Use custom ResultSetExtractor to handle the entire result set. |
When multiple mapping properties are configured, they take effect by priority: javaType > rowMapper > rowHandler > extractor; the first matching item takes priority.
RESULTUPDATE Rule
Marks a returned result as an update count (rather than a result set), used to distinguish the type of results returned by stored procedures.
Syntax:
@{resultUpdate, name = paramName}
| Name | Type | Description |
|---|---|---|
name | String | Name of the update count in the result. |
DEFAULTRESULT Rule
@{defaultResult} is equivalent to the global default configuration of @{resultSet}. When a query returns multiple result sets, you can use this rule to avoid repeating configurations for each result set.
Syntax:
@{defaultResult, key1 = value1, key2 = value2}
Property Description:
Supports javaType, rowMapper, rowHandler, extractor, meaning same as above.