代码如下:
List warningList = tbtInformationcompanyDao.getLimitPoByConditions(
"from TbtInformationcompany where companyid = "+ tbtCompany.getBusiness()
+" and informationid in (select id from TbtInformation where informationtype like '%;4;%' ) order by id desc,readflag desc", 5);
根据上面首页的代码用detachedCriteria来进行分页
DetachedCriteria detachedCriteria = DetachedCriteria
.forClass(TbtInformationcompany.class);
// 获取当前的用户
TbtCompany tbtCompany = SessionUtil.getUsertbtFromSession(request);
Long totalCount = tbtpageDao.getCount(detachedCriteria);
PageUtil pageUtil = new PageUtil(totalCount, request, pageQueryForm);
detachedCriteria.createAlias("tbtInformation", "tt");
                detachedCriteria.add(Restrictions.like("tt.informationtype", "%;4;%",MatchMode.ANYWHERE));//查出信息表中预警类别的信息

detachedCriteria.add(Restrictions.in("informationid", new Object[]{"tt.id"}));
                detachedCriteria.add(Restrictions.eq("companyid", tbtCompany.getId()));

List warninglist = tbtpageDao
.listByConditions(detachedCriteria, pageUtil.getPageQueryForm()
.getPageNo(), pageUtil.getPageSize());
其中detachedCriteria.add(Restrictions.in("informationid", new Object[]{"tt.id"}));
IN的用法有问题,错误信息为类型转换问题
java.lang.ClassCastException: java.lang.String
informationid和tt中id均为BIGINT型
正确写法是什么?