Mapped Statements collection does not contain value for
今天搞了个MyBatis+Spring的Demo,本来好好的,不知道是因为执行了mvn install/clean等命令,突然就不行了,哎,太折腾了。
下面贴下spring和myBatis的配置:

appctx-common.xml(省略了beans的namesapce):
mybatis-configuration.xml:
UserMapper.xml:
各位大虾帮看下哪里有问题。
下面贴下spring和myBatis的配置:

appctx-common.xml(省略了beans的namesapce):
<!-- 开启Autowired、Common、Persistence及Required标注的支持 -->
<context:annotation-config />
<context:property-placeholder location="classpath:jdbc.properties" />
<bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource" destroy-method="close">
<!-- Connection Info -->
<property name="driverClassName" value="${jdbc.driverClassName}" />
<property name="url" value="${jdbc.url}" />
<property name="username" value="${jdbc.username}" />
<property name="password" value="${jdbc.password}" />
<!-- Connection Pooling Info -->
<property name="maxActive" value="${dbcp.maxActive}" />
<property name="maxIdle" value="${dbcp.maxIdle}" />
<property name="defaultAutoCommit" value="false" />
<property name="timeBetweenEvictionRunsMillis" value="3600000"/>
<property name="minEvictableIdleTimeMillis" value="3600000"/>
</bean>
<!-- MyBatis integration with Spring as define sqlSessionFactory -->
<bean id="sqlSessionFactory" class="org.mybatis.spring.SqlSessionFactoryBean">
<property name="dataSource" ref="dataSource" />
<property name="configLocation" value="classpath:mybatis/mybatis-configuration.xml" />
<!--<property name="mapperLocations" value="classpath*:cn/git/mis/common/model/mapper/*.xml" />-->
</bean>
<!-- 采用扫描指定包的mapper接口,而不是一一定义每个mapper -->
<bean id="mapperScanner" class="org.mybatis.spring.mapper.MapperScannerConfigurer">
<property name="basePackage" value="cn.git.mis.common.model.mapper" />
<!-- <property name="sqlSessionFactoryBeanName" value="sqlSessionFactory" /> -->
</bean>
<!-- transaction manager, use JtaTransactionManager for global tx -->
<bean id="transactionManager" class="org.springframework.jdbc.datasource.DataSourceTransactionManager">
<property name="dataSource" ref="dataSource" />
</bean>
<tx:annotation-driven transaction-manager="transactionManager" />
mybatis-configuration.xml:
<configuration>
<typeAliases>
<typeAlias alias="User" type="cn.git.mis.common.model.bean.User" />
</typeAliases>
</configuration>
UserMapper.xml:
<mapper namespace="cn.git.mis.common.model.mapper.UserMapper">
<insert id="insertUser" parameterType="User" useGeneratedKeys="false" keyProperty="id">
insert into T_USER(id,gender,username,password) values(SEQ_USER_ID.nextval,#{gender},#{username},#{password})
</insert>
<select id="getUser" resultType="User" parameterType="map">
select * from T_USER where username = #{username} and password = #{password}
</select>
<select id="getUserById" resultType="User" parameterType="java.lang.Long">
select * from T_USER where id=#{id}
</select>
<update id="updateUser" parameterType="User">
update T_USER set gender=#{gender}, username = #{username} where id = #{id}
</update>
<update id="updateUserPwd" parameterType="map">
update T_USER set password=#{password} where id = #{id}
</update>
<delete id="deleteUserById">
delete from T_USER where id = #{id}
</delete>
</mapper>
各位大虾帮看下哪里有问题。
...全文
相关推荐
mybatisMapped报错 Statements collection does not contain value for
Statements collection does not contain value for”这样的错误提示。
mybatisMapped error Statements collection does not contain value for
代码下载链接: https://pan.quark.cn/s/145786a52cde ### mybatis映射报错:映射语句集合中不存在指定ID的语句在使用MyBatis框架执行数据库操作
CRM在通用.doc
### CRM在通用汽车中的应用及重要性#### 一、上海通用汽车背景介绍上海通用汽车有限公司是由上海汽车工业(集团)总公司与美国通用汽车公司共同出资成立的大型合资企业,双方各占50%的股份,总投资额达到了
Collections
This process does not affect the original dictionary.##### Using Custom KeysDictionaries can use any
Delphi7.1 Update
Delphi 7.1 Update Release Notes=======================================================This file cont


