执行以已下代码报报错什么原因?具体如何处理? String sql_hql=select x where JadVillageEntity x JadNatvillageEntity y where xC_ID=yR_VILLAGE_ID and yC_ID= and yC_DELETED=0 and xC_DELETED=0 ; JadVillag
该错误是因为在HQL语句中使用了"select x."这样的语法,但HQL不支持使用""通配符来选择所有列。
要修复该错误,可以将HQL语句修改为选择具体的列,或者使用"select x"来选择整个实体对象。具体如下:
-
选择具体的列: String sql_hql = "select x.column1, x.column2, ... where JadVillageEntity x, JadNatvillageEntity y where x.C_ID = y.R_VILLAGE_ID and y.C_ID = ? and y.C_DELETED = 0 and x.C_DELETED = 0";
-
选择整个实体对象: String sql_hql = "select x where JadVillageEntity x, JadNatvillageEntity y where x.C_ID = y.R_VILLAGE_ID and y.C_ID = ? and y.C_DELETED = 0 and x.C_DELETED = 0";
原文地址: http://www.cveoy.top/t/topic/i0It 著作权归作者所有。请勿转载和采集!