问题描述
- sql查询实体问题。。。。。
-
public Map delete(JSONObject head, JSONObject body)
throws Exception {
Map attributes=new HashMap();
JSONArray couponJson=body.optJSONArray("couponId");String token=head.optString("token"); Object object=UserCacheManage.getAppUser(token); //if(object!=null){ //UserCache user=(UserCache)object; String userId="4028668150c6aedb0150c6ddde750005"; 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 query ="SELECT c FROM couponpublish c,couponpool s WHERE s.owner='"+userId+"' and c.pubid=s.pubid"; List<CouponPublishEntity> list = super.findListbySqlReturnMap(query); if(list!=null&&list.size()>0){ super.deleteAllEntitie(list); }
想查询couponpublish表的实体然后删除掉,但是报错Unknown column 'c' in 'field list'
select c这样写不行。。应该咋写= =
解决方案
c是表名,不能直接 selcet c 你是想显示c表中的所有列吗?可以用 select c.*
时间: 2024-12-31 12:41:26