hql查询问题。。。。。

后台代码:

HhUserEntity hhUserEntity=super.getEntity(HhUserEntity.class, userId);
        if(hhUserEntity!=null){
            String ids="";
            Object [] couponIds=(Object[])couponJson.toArray();
            if(couponIds!=null&&couponIds.length>0){
                for(int i=0;i<couponIds.length;i++){
                    if(i==0){
                        ids=ids+"'"+couponIds[i]+"'";
                    }else{
                        ids=ids+",'"+couponIds[i]+"'";
                    }
                }    
            }
            
            String hql="from CouponPublishEntity e left join CouponPoolEntity d where d.pubId=e.pubId and  d.owner='"+userId+"' and e.pubid in ("+ids+") ";
            List<HhCouponsEntity> list = super.findByQueryString(hql);
            System.out.println(list);
            if(list!=null&&list.size()>0){
                super.deleteAllEntitie(list);
            }
            

报错:
[org.jeecgframework.core.common.exception.GlobalExceptionResolver]全局处理异常捕获:
org.hibernate.QueryException: could not resolve property: pubid of: com.sendiy.hh.coupons.entity.CouponPublishEntity [from com.sendiy.hh.coupons.entity.CouponPublishEntity e left join Coupon 。。。

"obj": {

    "code": "201",
    "msg": "could not resolve property: pubid of: com.sendiy.hh.coupons.entity.CouponPublishEntity [from com.sendiy.hh.coupons.entity.CouponPublishEntity e left join CouponPoolEntity d where d.pubId=e.pubId and  d.owner='4028668150c6aedb0150c6ddde750005' and e.pubid in ('2') ]"
},
"attributes": {},
"msg": "操作成功",
"success": true

阅读 3k
1 个回答

检查下两个数据库表映射实体,无码,应该出现在id的问题

撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
推荐问题