mybatis mapper.xml 报错java.lang.UnsupportedOperationException

今天在一个springboot 项目里面写个查询报错java.lang.UnsupportedOperationException

	Caused by: org.apache.ibatis.exceptions.PersistenceException: 
### Error querying database.  Cause: java.lang.UnsupportedOperationException
### The error may exist in file [E:\clj\demo\target\classes\cn\demo\modular\system\mapper\mapping\ProductMapper.xml]
### The error may involve cn.demo.modular.system.mapper.ProductMapper.getProductList
### The error occurred while handling results
### SQL: select                   product_id AS productId, name, image, type, remark               from sys_product where 1 = 1         order by product_id ASC
### Cause: java.lang.UnsupportedOperationException
	at org.apache.ibatis.exceptions.ExceptionFactory.wrapException(ExceptionFactory.java:30)
	at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:150)
	at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:141)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
	at java.lang.reflect.Method.invoke(Unknown Source)
	at org.mybatis.spring.SqlSessionTemplateTSqlSessionInterceptor.invoke(SqlSessionTemplate.java:433)
	... 111 more

mapper接口返回类型是List

public interface ProductMapper extends BaseMapper<Product>{
	public List<Product> getProductList();
}

xml select标签resultTyep不能用list要用实体类,错误解决。

	<select id="getProductList" resultType="cn.demo.modular.system.entity.Product"><!-- resultType="java.util.List" -->
        select
        <include refid="Base_Column_List"/>
        from sys_product where 1 = 1
        order by product_id ASC
    </select>
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值