2014-02-16 14:52:58.475:WARN:oejs.ServletHandler:/mideaAdmin/deleteUser.midea
org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.reflection.ReflectionException: There is no getter for property named 'userIds' in 'class java.lang.String'
at org.mybatis.spring.MyBatisExceptionTranslator.translateExceptionIfPossible(MyBatisExceptionTranslator.java:73)
at org.mybatis.spring.SqlSessionTemplate$SqlSessionInterceptor.invoke(SqlSessionTemplate.java:358)
at $Proxy23.update(Unknown Source)
at org.mybatis.spring.SqlSessionTemplate.update(SqlSessionTemplate.java:246)
at org.apache.ibatis.binding.MapperMethod.execute(MapperMethod.java:62)
at org.apache.ibatis.binding.MapperProxy.invoke(MapperProxy.java:25)
at $Proxy30.deleteUser(Unknown Source)
at com.hailong.midea.busi.user.manager.UserManager.deleteUser(UserManager.java:80)
at com.hailong.midea.web.controller.user.UserController.deleteUser(UserController.java:147)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:754)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:847)
at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:594)
at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1365)
at com.hailong.midea.web.filter.SessionFilter.doFilterInternal(SessionFilter.java:80)
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76)
at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1336)
at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:88)
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76)
at org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerCollection.java:149)
at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:111)
at org.eclipse.jetty.server.Server.handle(Server.java:351)
at org.eclipse.jetty.server.AbstractHttpConnection.handleRequest(AbstractHttpConnection.java:451)
at org.eclipse.jetty.server.AbstractHttpConnection$RequestHandler.content(AbstractHttpConnection.java:931)
at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:857)
at org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:230)
at org.eclipse.jetty.server.AsyncHttpConnection.handle(AsyncHttpConnection.java:76)
at org.eclipse.jetty.io.nio.SelectChannelEndPoint.handle(SelectChannelEndPoint.java:609)
at org.eclipse.jetty.io.nio.SelectChannelEndPoint$1.run(SelectChannelEndPoint.java:45)
at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:599)
at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:534)
at java.lang.Thread.run(Thread.java:662)
Caused by:
org.apache.ibatis.reflection.ReflectionException: There is no getter for property named 'userIds' in 'class java.lang.String'
at org.apache.ibatis.reflection.Reflector.getGetInvoker(Reflector.java:308)
at org.apache.ibatis.reflection.MetaClass.getGetInvoker(MetaClass.java:93)
at org.apache.ibatis.reflection.wrapper.BeanWrapper.getBeanProperty(BeanWrapper.java:134)
at org.apache.ibatis.reflection.wrapper.BeanWrapper.get(BeanWrapper.java:27)
at org.apache.ibatis.reflection.MetaObject.getValue(MetaObject.java:103)
at org.apache.ibatis.builder.xml.dynamic.DynamicContext$ContextMap.get(DynamicContext.java:72)
at org.apache.ibatis.builder.xml.dynamic.DynamicContext$ContextAccessor.getProperty(DynamicContext.java:90)
at org.apache.ibatis.ognl.OgnlRuntime.getProperty(OgnlRuntime.java:1657)
at org.apache.ibatis.ognl.ASTProperty.getValueBody(ASTProperty.java:92)
at org.apache.ibatis.ognl.SimpleNode.evaluateGetValueBody(SimpleNode.java:170)
at org.apache.ibatis.ognl.SimpleNode.getValue(SimpleNode.java:210)
at org.apache.ibatis.ognl.Ognl.getValue(Ognl.java:333)
at org.apache.ibatis.ognl.Ognl.getValue(Ognl.java:413)
at org.apache.ibatis.ognl.Ognl.getValue(Ognl.java:454)
解决方案:
引起问题的原因是因为在DAO方法中定义的参数 与 实体中定义的属性不一致 导致的,
比如DAO方法定义的是:
public int deleteUser(String userIds);
SQL语句如下:
<!-- 删除用户(逻辑删除) -->
<update id="deleteUser" parameterType="String">
UPDATE t_user t SET t.user_status = '禁用' WHERE t.user_pk_id IN(#{userIds})
</update>
UserEntity的定义:
public class UserEntity extends AbstractEntity{
private int userPkId;
private String userId;
private String userName;
private String sex;
private byte age;
}
这个userIds并不在UserEntity中存在,而userId是存在的,如果使用UserEntity中不存在userIds的属性 所以会报此错误。改成userId 问题即可解决。
相关推荐
`org.apache.ibatis.annotations.Param`是MyBatis中的一个重要注解,用于处理方法参数映射。 `@Param`注解主要用于SQL查询中的动态参数绑定,尤其是在动态SQL语句中。在MyBatis的映射文件或者Mapper接口中,当我们...
在使用Mybatis框架时,你可能会遇到`org.apache.ibatis.exceptions.PersistenceException`这样的异常。这个异常通常表示在执行数据库查询操作时遇到了问题。本篇将详细分析这个问题并提供解决方法。 ### 问题概述 ...
org.apache.ibatis.logging org.apache.ibatis.logging.commons org.apache.ibatis.logging.jdbc org.apache.ibatis.logging.jdk14 org.apache.ibatis.logging.log4j org.apache.ibatis.logging.log4j2 org.apache....
│ │ │ frame-sourcefiles-org.apache.ibatis.reflection.property.html │ │ │ frame-sourcefiles-org.apache.ibatis.reflection.wrapper.html │ │ │ frame-sourcefiles-org.apache.ibatis.scripting....
iBATIS,全称为“Infrastructure for Binding Applications To SQL Maps”,是一个优秀的开源持久层框架,它允许Java开发者将SQL语句与Java代码分离,提供了一种简单但强大的在Java应用中映射SQL和结果集的方式。...
常问问题1,出现了如下BUG org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.reflection.ReflectionException: There is no getter for property named 'statement' in 'class ...
纵观目前主流的 ORM(对象关系映射),无论 Hibernate还是Apache OJB,都对数据库结构提供了较为完整的封装,提供了从POJO到数据库表的全套映射机制。程序员往往只需定义好了POJO 到数据库表的映射关系,即可通过 ...
apache开源项目源码ibatis-3-core-src-3.0.0.227 ibatis框架java源程序 spring,struts,hibernate,ibatis,框架源码 各种ibatis框架应用源码,你会从中得到意想不到的效果! apache开源组织开发的开源项目源码,其...
1. **IBATIS核心库**: 包含了ibatis-2.x.jar,这是IBATIS框架的主要实现,提供了SQL映射文件解析、事务管理、结果集处理等功能。 2. **JDBC驱动**: 根据实际使用的数据库类型,如MySQL、Oracle、SQL Server等,需要...
标题和描述中提到的"IBatisNet.Common.1.6.2、IBatis.DataAccess.1.9.2、IBatis.DataMapper.1.6.2"是针对一个名为IBatisNet的框架的不同组件的版本号。IBatisNet是一个在.NET平台上实现的开源持久层框架,它源于Java...
log4j.logger.org.apache.ibatis=DEBUG log4j.logger.jdbc.sqltiming=DEBUG ``` 上述配置将使得Ibatis的SQL语句及其执行时间被输出到控制台。`%d{ABSOLUTE}`是时间戳,`%5p`是日志级别,`%c{1}`是类名,`%L`是行号...
Caused By: org.apache.ibatis.builder.BuilderException: Could not find SQL statement to include with refid 'SAD02.SAD02_COL' at org.apache.ibatis.builder.xml.XMLStatementBuilder$IncludeNodeHandler....
log4j.addivity.org.apache=true log4j.logger.com.ibatis = ERROR log4j.logger.com.ibatis.common.jdbc.SimpleDataSource = ERROR #log4j.logger.com.ibatis.common.jdbc.ScriptRunner = ERROR #log4j....
要大于20个字符要大于20个字符要大于20个字符要大于20个字符要大于20个字符要大于20个字符要大于20个字符要大于20个字符要大于20个字符
<bean id="sqlMapClient" class="org.springframework.orm.ibatis.SqlMapClientFactoryBean"> <value>classpath:SqlMapConfig.xml <bean id="dao" class="org.springframework.orm.ibatis....
org.apache.ibatis org.apache.juli 4号包: org.apache.tiles org.apache.velocity org.apache.xerces org.apache.xml org.apache.xmlbeans org.apache.xmlcommons org.apache.derby org.apache.poi org.apache....
org.apache.ibatis org.apache.juli 4号包: org.apache.tiles org.apache.velocity org.apache.xerces org.apache.xml org.apache.xmlbeans org.apache.xmlcommons org.apache.derby org.apache.poi org.apache....
org.apache.ibatis org.apache.juli 4号包: org.apache.tiles org.apache.velocity org.apache.xerces org.apache.xml org.apache.xmlbeans org.apache.xmlcommons org.apache.derby org.apache.poi org.apache....