首页 > 其他分享 >LambdaQueryWrapper

LambdaQueryWrapper

时间:2023-01-27 15:33:48浏览次数:51  
标签:LambdaQueryWrapper list alarmRuleNewLambdaQueryWrapper daoContext 字段名 表达式

LambdaQueryWrapper

解决拼接条件表达式时候,数据库字段名写错导致异常的问题

代码范例

LambdaQueryWrapper<AlarmRuleNew> alarmRuleNewLambdaQueryWrapper = new LambdaQueryWrapper<AlarmRuleNew>();
// 写表达式时,直接用::形式获取对应的字段名
alarmRuleNewLambdaQueryWrapper.eq(AlarmRuleNew::getRuleKey,"3"); 
List<AlarmRuleNew> list = daoContext.getAlarmRuleNewDaoService().list(alarmRuleNewLambdaQueryWrapper);

标签:LambdaQueryWrapper,list,alarmRuleNewLambdaQueryWrapper,daoContext,字段名,表达式
From: https://www.cnblogs.com/PythonOrg/p/17068934.html

相关文章