Mybatis open hump named role

In applocation.yml file,

the mybatis: 
the Configuration:
# format to turn automatic underlining camelCased
the Map-Underscore-to-CAMEL-Case: to true
config-locations: the CLASSPATH: /mybatisConfig.xml
Mapper-locations: the CLASSPATH:. the mybatis / ** / * xml
of the type-aliases -package: com.lvjing.domain

the Configuration: 
# format to turn automatic underlining camelCased
the Map-Underscore-to-CAMEL-Case: to true
     # The following higher priority
      mapUnderscoreToCamelCase: true 


can also be written in the mybatisConfig.xml
<configuration>
    <! - open hump naming rules automatically converted ->
    <settings>
    <setting name="mapUnderscoreToCamelCase" value="true" />
    </settings>
</ configuration> 



effect:
you can save a write resultMap

not open:
<resultMap id="BaseResultMap" type="com.lvjing.domain.housekeeping.WxCleaner">
<result column="id" property="id"/>
<result column="cleaner_name" property="cleanerName"/>
<result column="cleaner_mobile" property="cleanerMobile"/>
<result column="current_order" property="currentOrder"/>
<result column="password" property="password"/>
<result column="remark" property="remark"/>
<result column="create_time" property="createTime"/>
</resultMap>

开启:(只需要指定对应pojo实体类)
<resultMap id="BaseResultMap" type="com.lvjing.domain.housekeeping.WxCleaner">
</resultMap>



However, mapping different fields, the need to cooperate resultMap
only labor-saving tool, specific development process should be used in conjunction with resultMap together.

Guess you like

Origin www.cnblogs.com/zhuangyao/p/12171090.html