下面是我的报错信息
at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:148)
at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:141)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.mybatis.spring.SqlSessionTemplate$SqlSessionInterceptor.invoke(SqlSessionTemplate.java:433)
... 36 more
Caused by: java.lang.IllegalArgumentException: argument type mismatch
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.apache.ibatis.reflection.invoker.MethodInvoker.invoke(MethodInvoker.java:41)
at org.apache.ibatis.reflection.wrapper.BeanWrapper.setBeanProperty(BeanWrapper.java:180)
... 59 more
INFO GenericWebApplicationContext - Closing org.springframework.web.context.support.GenericWebApplicationContext@3738449f: startup date [Sun Jan 06 09:10:02 CST 2019]; root of context hierarchy
INFO DruidDataSource - {dataSource-1} closed
这是我的报错代码
<resultMap id="a1" type="com.baizhi.entity.Album">
<result column="album_id" property="albumId"/>
<result column="album_name" property="albumName"/>
<result column="album_author" property="albumAuthor"/>
<result column="album_status" property="lessonStatus"/>
<result column="album_teller" property="albumTeller"/>
<result column="album_episodes" property="albumEpisodes"/>
<result column="album_date" property="albumDate"/>
<result column="album_content" property="albumContent"/>
<result column="album_image" property="albumImage"/>
<result column="album_star" property="albumStar"/>
<association property="listaudio" javaType="com.baizhi.entity.Audio">
<result column="album_id" property="audioId"/>
<result column="album_name" property="audioName"/>
<result column="aid" property="albumId"/>
<result column="audio_url" property="audioUrl"/>
<result column="audio_size" property="audioSize"/>
<result column="audio_order" property="audioOrder"/>
</association>
</resultMap> 下面是我的改正信息
<resultMap id="a1" type="com.baizhi.entity.Album">
<result column="album_id" property="albumId"/>
<result column="album_name" property="albumName"/>
<result column="album_author" property="albumAuthor"/>
<result column="album_status" property="lessonStatus"/>
<result column="album_teller" property="albumTeller"/>
<result column="album_episodes" property="albumEpisodes"/>
<result column="album_date" property="albumDate"/>
<result column="album_content" property="albumContent"/>
<result column="album_image" property="albumImage"/>
<result column="album_star" property="albumStar"/>
<collection property="listaudio" ofType="com.baizhi.entity.Audio">
<result column="album_id" property="audioId"/>
<result column="album_name" property="audioName"/>
<result column="aid" property="albumId"/>
<result column="audio_url" property="audioUrl"/>
<result column="audio_size" property="audioSize"/>
<result column="audio_order" property="audioOrder"/>
</collection>
</resultMap> 粗心粗心!当遇到这个问题时,我就想到一定是映射问题.我所在的关注点上面一直都是字段名,万万没想到把映射关系的单词弄错了!!!!!!!!!!!!!!atm也是醉了
上百度上看了很多博客有的说没有get,set,等等,出现报错,小石榴建议你们一定先不要看百度,自己找找看再讲啦,实在不会就看百度嘛.
希望对你们有所帮助!