问题求助,大佬,咩走啊。。。。。。
1.问题
ssm框架,后端使用实体类接收mybatis的查询数据,实体类属性全=null,前端却能接收到值。
2.截图
3.环境
mybatis-3.4.6、mybatis-spring-1.3.3、spring-5.2.0
4.补充
1.实体类未加任何注解,属性驼峰命名,无参构造方法、getter/setter都有
2.mapper.xml如下:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mabatis-3-mapper.dtd">
<mapper namespace="demo.dao.dataSourceTwo.IDemoJobDataDao">
<resultMap id="DemoJobData" type="demo.entity.DemoJobData">
<id column="id" property="id" jdbcType="VARCHAR" />
<result column="job_name" property="jobName" jdbcType="VARCHAR" />
<result column="trigger_cron" property="triggerCron" jdbcType="VARCHAR" />
<result column="description" property="description" jdbcType="VARCHAR" />
<result column="status" property="status" jdbcType="INTEGER" />
</resultMap>
<select id="findByStatus" resultMap="DemoJobData">
SELECT id as, job_name, trigger_cron, description, status FROM
d_job_data WHERE status = #{status, jdbcType=INTEGER}
</select>
</mapper>
3.项目使用分包的方式,配置了多个数据源,这个自动转驼峰也一直不生效
<!-- 使用spring方式,创建会话工厂的组件 -->
<bean id="sqlSessionFactoryTwo" class="org.mybatis.spring.SqlSessionFactoryBean">
<property name="dataSource" ref="dataSourceTwo" />
<property name="mapperLocations" value="classpath:demo/mapper/dataSourceTwo/*.xml" />
<property name="configuration">
<bean class="org.apache.ibatis.session.Configuration">
<property name="mapUnderscoreToCamelCase" value="true" />
</bean>
</property>
</bean>
4.我已经疯掉了☹