mybatis result set mapping ResultMap

Problem presentation

solution

1. SQL alias (not recommended)

2. ResultMap (recommended)


 

Problem presentation

The department name field cannot be mapped. Even if mybatis camel case name mapping is turned on, Mybatis does not open the camel case name mapping mapUnderscoreToCamelCase , because this attribute is different from the database column word, it is 2 words at all

solution

1. SQL alias (not recommended)

2. ResultMap (recommended)

 

Guess you like

Origin blog.csdn.net/lgl782519197/article/details/109219186