本文整理汇总了Java中org.hibernate.Query.setByte方法的典型用法代码示例。如果您正苦于以下问题:Java Query.setByte方法的具体用法?Java Query.setByte怎么用?Java Query.setByte使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.hibernate.Query
的用法示例。
在下文中一共展示了Query.setByte方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: search
import org.hibernate.Query; //导入方法依赖的package包/类
@Override
public List<MarketApp> search(EnumMarket enumMarket, Short catalog, Integer subCatalog, int page, int rows,
String keywords, Integer id, Integer cputype, String sort, String order, Date startDate, Date endDate) {
List<MarketApp> list = null;
// cpu的类型为空的时候我们只需要到MarketApp中查找
if (cputype == null)
cputype = 0;
if (cputype.byteValue() == 0) {
list = findMarketAppList(enumMarket, catalog, subCatalog, page, rows, keywords, id, sort, order, startDate,
endDate);
} else { // cpu的类型为空的时候我们需要先到BigGamePack中查询一下然后再到MarketApp中查找
list = new ArrayList<MarketApp>();
List<MarketApp> marketList = findMarketAppList(enumMarket, catalog, subCatalog, page, rows, keywords, id,
sort, order, startDate, endDate);
String hql = "from BigGamePack where cputype =:cputype group by MarketAppId";
Query query = getSession().createQuery(hql);
query.setByte("cputype", cputype.byteValue());
List<BigGamePack> bgList = HibernateHelper.list(query);
if (null != bgList && bgList.size() > 0 && null != marketList && marketList.size() > 0) {
for (BigGamePack bigGamePack : bgList) {
for (MarketApp mp : marketList) {
if (mp.getId() == bigGamePack.getMarketAppId()) {
list.add(mp);
}
}
}
}
}
return list;
}