首页 > hql关联查询报错。。。

hql关联查询报错。。。

代码:

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 inner join e.CouponPoolEntity c where c.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.hibernate.QueryException: could not resolve property: CouponPoolEntity of: com.sendiy.hh.coupons.entity.CouponPublishEntity [from com.sendiy.hh.coupons.entity.CouponPublishEntity e inner join e.CouponPoolEntity c where c.owner='4028668150c6aedb0150c6ddde750005' and e.pubid in ('2') ]
这是实体类的问题吗?
实体类:
@Entity

@Table(name = "couponpool", schema = "")
@SuppressWarnings("serial")
public class CouponPoolEntity implements java.io.Serializable {

/**couponseqid*/
private java.lang.Integer couponSeqId;
/**批次号*/
private java.lang.String pubId;
/**序号*/
private java.lang.String couponNo;
/**验证码*/
private java.lang.String serialno;
        

【热门文章】
【热门文章】