日本免费高清视频-国产福利视频导航-黄色在线播放国产-天天操天天操天天操天天操|www.shdianci.com

學(xué)無先后,達(dá)者為師

網(wǎng)站首頁 編程語言 正文

該方法僅能傳入 lambda 表達(dá)式產(chǎn)生的合成類

作者:何中應(yīng) 更新時(shí)間: 2023-12-10 編程語言

說明:使用Mybatis-plus查詢記錄時(shí),出現(xiàn)下面的錯(cuò)誤;

org.apache.ibatis.builder.BuilderException: Error evaluating expression 'ew.sqlSegment != null and ew.sqlSegment != '' and ew.nonEmptyOfWhere'. Cause: org.apache.ibatis.ognl.OgnlException: sqlSegment [com.baomidou.mybatisplus.core.exceptions.MybatisPlusException: 該方法僅能傳入 lambda 表達(dá)式產(chǎn)生的合成類]

在這里插入圖片描述

解決1:這個(gè)問題可能與返回的實(shí)體類是否實(shí)現(xiàn)序列化接口有關(guān)(Serializable)

在這里插入圖片描述

解決2:另外,可能與執(zhí)行此方法的Service相關(guān),Service接口實(shí)現(xiàn)類里面的泛型,ServiceImpl類繼承的泛型,應(yīng)該是操作的數(shù)據(jù)庫表對(duì)應(yīng)的實(shí)體類

(Service接口)

public interface IUserInfoService extends IService<實(shí)體類> {

(Service實(shí)現(xiàn)類)

public class UserInfoServiceImpl extends ServiceImpl<UserInfoMapper, 實(shí)體類> implements IUserInfoService {

解決3:我的問題是實(shí)體類與查詢的數(shù)據(jù)庫表字段對(duì)不上,但是我不想改動(dòng)實(shí)體類字段,就不能使用MyBatis-plus封裝的方法,只能去Mapper.xml寫查詢SQL;

原文鏈接:https://blog.csdn.net/qq_42108331/article/details/133932325

  • 上一篇:沒有了
  • 下一篇:沒有了
欄目分類
最近更新