com.baomidou.mybatisplus.extension.handlers.MybatisMapWrapper Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of mybatis-plus-extension Show documentation
Show all versions of mybatis-plus-extension Show documentation
An enhanced toolkit of Mybatis to simplify development.
package com.baomidou.mybatisplus.extension.handlers;
import java.util.Map;
import org.apache.ibatis.reflection.MetaObject;
import org.apache.ibatis.reflection.wrapper.MapWrapper;
import com.baomidou.mybatisplus.core.toolkit.StringPool;
import com.baomidou.mybatisplus.core.toolkit.StringUtils;
/**
*
* 返回Map结果集,下划线转驼峰
*
*
* @author yuxiaobin
* @since 2017/12/19
*/
public class MybatisMapWrapper extends MapWrapper {
public MybatisMapWrapper(MetaObject metaObject, Map map) {
super(metaObject, map);
}
@Override
public String findProperty(String name, boolean useCamelCaseMapping) {
if (useCamelCaseMapping
&& ((name.charAt(0) >= 'A' && name.charAt(0) <= 'Z')
|| name.contains(StringPool.UNDERSCORE))) {
return StringUtils.underlineToCamel(name);
}
return name;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy