ZhiYouToolkit Help

Generate MyBatis ResultMap Tag

How to use

  • Prerequisite: The mouse cursor must be within a Java class or XML file with properties.

  • Usage: Right-click to open the context menu, then click Extended Features... >> Generate ResultMap Tag.

  • Default shortcut key: Ctrl + Alt + 7 >> then press 2.

Note

  • When the mouse cursor is in a Java class, the current Java class will be used as the mapping class by default, and the generated ResultMap tag will be copied to the clipboard.

  • When the mouse cursor is in an XML file, you need to select a Java class. The selected Java class will be used as the mapping class, and the generated ResultMap will be directly inserted at the mouse cursor position.

Code Examples

// Avoid using SELECT *. // Only the fields part after SELECT is needed. SELECT id, name, age
// SQL fields correspond to Java properties. private Integer id; private String name; private Integer age;

Result
Last modified: 18 June 2024