主题 : jspgou, java.lang.Integer cannot be cast to [Ljava.lang.Object;报这个错
级别: 举人
UID: 74230
积分:183 加为好友
威望: 8 精华: 0
主题:36 回复:117
注册时间:2015-04-15
在线时长:0
1#   发表于:2015-08-15 11:31:19  IP:61.85.*.*
protected int countQueryResultSQL(Finder finder) {
Query query = getSession().createSQLQuery(finder.getRowCountHqlSQL());
finder.setParamsToQuery(query);
if (finder.isCacheable()) {
query.setCacheable(true);
}
query.uniqueResult();
return ((Number) query.uniqueResult()).intValue();
}
您好,我想问一下,因为有些属性 hql 不能够完成,想用sql 语句写的,,就是管理员后页面上,调用这个方法,没有问题,但是,前台用标签调这个方法,就报错, java.lang.Integer cannot be cast to [Ljava.lang.Object;,请大神指教
级别: 举人
UID: 74230
积分:183 加为好友
威望: 8 精华: 0
主题:36 回复:117
注册时间:2015-04-15
在线时长:0
2#   发表于:2015-08-15 11:32:24  IP:61.85.*.*
用的,jspgou4.5的
级别: 举人
UID: 74230
积分:183 加为好友
威望: 8 精华: 0
主题:36 回复:117
注册时间:2015-04-15
在线时长:0
3#   发表于:2015-08-15 11:34:17  IP:61.85.*.*
这是我写的,sql语句,select count(*) from (select  b.*,ISNULL((select pp.shunxu from jc_shop_sp pp where b.ztdaihao=pp.shangpingid and b.attr_value='26'),0) shunxu  ,(select jw.suffix from jc_core_website jw where b.website_id=jw.website_id) suffix ,  (select jw.is_relative_path from jc_core_website jw where b.website_id=jw.website_id) is_relative_path ,   (select jw.domain from jc_core_website jw where b.website_id=jw.website_id) domain ,    (select jcy.path  from jc_shop_category jcy where b.category_id=jcy.category_id) path ,   (select jg.context_path from jc_core_global jg where b.website_id=jg.global_id) context_path ,    (select jg.port from jc_core_global jg where b.website_id=jg.global_id) port,    (select jt.cover_img from jc_shop_product_ext jt where b.product_id=jt.product_id) cover_img,  dbo.quannian(b.ztdaihao) quannian  from    ( select MAX(js.name) name,MAX(je.attr_value)attr_value ,producttex2_.ztdaihao    ,MAX(js.product_id) product_id,MAX(js.sale_price) sale_price ,   MAX(js.website_id) website_id,MAX(js.category_id) category_id   from jc_shop_product js     join jc_shop_product_exended je on js.product_id=je.product_id     cross join jc_shop_product_text producttex2_     where js.product_id=producttex2_.product_id and    je.attr_name='qikanfenlei' and je.attr_value='26' and js.on_sale='1'   and  producttex2_.qishu is not null and producttex2_.qishu='1' group by producttex2_.ztdaihao) b   ) c  在数据库中,是可以执行成功的
级别: 总版主
UID: 10736
积分:148381 加为好友
威望: 205 精华: 42
主题:287 回复:126139
注册时间:2010-09-08
在线时长:15.55
4#   发表于:2015-08-17 14:30:36  IP:115.64.*.*
您自己写的肯定是你sql语句有问题了
路漫漫其修远兮,吾将上下而求索!
1 共1页