执行以下限制会遇到以下错误
Message: java.lang.String cannot be cast to java.lang.Integer
if (suburbid > 0) {
criteria.add(Restrictions.ilike("suburb.id", suburbid));
}
答案 0 :(得分:0)
更改
criteria.add(Restrictions.ilike("address.subrub.id", suburbid));
到
criteria.add(Restrictions.ilike("suburb.id", suburbid));
<强>更新强>
还尝试更改
.createAlias("development.address.suburb", "suburb");
到
.createAlias("devAddress.suburb", "suburb");
答案 1 :(得分:0)
您不能使用Like进行整数更改为eq。